Arrays are consecutive group of memory locations that all have the same name and the same type. To refer to a particular element in the array of location, we specif y the name and the position number in the array.
A multidimensional array with dimension of n is a single dimension array with each element having n-1 dimensional array.
Slices are substructure of an array.
Example: response(1..4) := "FRED";
A record, like an array, is a data structure for storing related items where elements are identified by their file name.
A character string is a sequence of characters. It is exactly the same as an array of characters.
Pointers are variables that contain memory addresses as their values.
A set is an unordered collection of values that are all the same ordinal type.
A file is a sequence of components that may be homogenous or heterogeneous and is a structured type.
Variant records are the same as records only that they have case statement.
Execute same operations in normal Records only that there is an additional case statement.Real-time system for controlling satellite systems
In real time system, rigid time requirements must be fulfilled. In this case, the satellite must have sensors to detect and bring data to the satelli te system. The system must analyze the data and may want to adjust controls to modify the appropriate sensors input or output. Processing must be done in the defined constraint if not the satellite system will fail. Therefore, in order for the system to work properly, data management is important and crucial in this system.
Array is stored in memory as contiguous elements. They are usually in stored in Row or Column order. So, a mapping function is needed to locate an ele ment of an array as stored in the memory. In this case, the satellite system can use array to store data needed from its sensor input. Its mapping function then can later retrieve the data by locating its location in the memory.
Certain languages limit the number of available dimensions because they are associated with performance problems. In this satellite system, the system can use multidimensional array to store all its sensor inputs or outputs. I must say that this may get complicated because it has many inputs and outputs. However, it's a good storage management for storing data that are not needed frequently in daily processing.
The range of the slice have to be determined first if we want to use it. In the satellite system, we can use slices so store data for example, temperature of the satellite, at a certain of time range.
Advantage of using records rather than arrays is that the data types in records need not be the same. In this case, the satellite system can store multiple data, such as its location, its temperature and data input all in the same record.
Lists can be used to store tasks for the satellite system. In this case, the system is responsible to retrieve, read and perform the tasks in the lists accordingly. The performance and efficiently of the lists can be improved with the implementation of the lists with pointers. This enables dynamic access to the list.
In the satellite system, lets assume that the system supports string operations. The processed data of the operation in the system can then be stored dynamically strings. In dynamic strings, the lengths of the strings are not fixed, thus providing more flexibility to the system.
Pointers are needed in dynamic storage management. In the satellite system, pointers are extremely useful in allocating available memor y storage and deallocating unwanted storage.
Sets can be use to store categories of result. The advantage of putting these categories in sets rather than in arrays is because sets have their own operations such as union and intersection. Therefore, with these operations, it improves the efficiency of the system.
Files (Input file)
Input files supplies data for the satellite system. These files can be stored in a database so that the system can access i t whenever needed.
Variant record is an extension of record only that it has a case selection. The selection allows easier categorization of data into the specific record. For example, the satellite system is inputting some data collected from the experiment. With the variant record, the system will be able to know the type of the experiment ( in the case selection).
Event driven system for automated manufacturing system
Assume that this automated manufacturing system is a se wing machine which could sew a design according to the user input. This machine would know which design to get and how to sew that particular design. This machine would know when and where to sew different color in different places. Therefore, in order for the machine to work, the system must contain all the designs and information on the color threads and must be able to function accordingly.
Arrays in the system are used to stor e file names where each file name represents an individual design. When user enter input, a case statement is used to determine the specific file in the array that will be used.
Multidimensional arrays are used to store the coordinates to sew a particular color according to the design. For example, (x1, y1) sew black color and (x2, y2) paint yellow color. A mapping function in the system will be used to locate the coordinates.
The range of the slice must first be determined. In this case, the range contains the coordinates of the design have the same color of thread. The slices are used to store the coordinates of the design with the same color of threads.
Advantage of using records rather than arrays is that the data types in records need not be the same. In this case, the system ca n store multiple data, such as its coordinates and its color threads information in a record.
Lists are used to store the list of instructions on how to sew a design. In this case, the system is responsible to retrieve, read and perform the tasks in the lists accordingly. The performance and efficiently of the lists can be improved with the implementation of the lists with pointers. This enables dynamic access to the list.
Character strings are not appropriate to be used in the system because designs in the system are represented in coordinates (integers) and not in characters or string.
Pointers are needed in dynamic storage management. In this manufacturing system, the pointers are used to allocate the location of the list of instructions. Also, the pointer points to a coordinate w hich represent the current color to be sewn.
Sets can be used to store a set of file names where each file name represents an individual design.
Since input files store the coordinates for the design, the file then can be translated into multidimensional arrays.
Variant records can be u sed so that we we can put all the designs into one file and then use the case statement of variant records to filter out the desired design.
The goal of an intelligent tutoring system is to speed a student's learning curve. This is accomplished by eliminating time spent on subject areas understood by the student and concentrating on those weaker areas. Keeping this in mind, it is necessary that an intelligent tutoring system be able to make decisions. The tutoring system must be able to keep track of student answers and subject areas' scores. Using this data, the system will prioritize subject areas and be able to recalculate scores on the fly.
An array would be ideal for storing students' scores in an intelligent tutoring system. Student's would be able to save their work and resume a t a later time. In this syntax, the index_value_list would represent the student's unique id number and the element would represent the student's current overall score:
array_name(index_value_list) -> element.
Multidimensional arrays would be used in this system to track student progress in a subject area. For example, in the element (x1,y1) x1 represents the subject area and y1 represents a sub-subject area. This will allow for retesting in a more narrowed area.
For an intelligent tutoring system, the range of a slice could contain elements with the same subject area. For example, the slice (x1,y1:n) would contain all the elements for subject area x1. All of these sub-subject scores would represent the score for subject x1.
Records would be used to expand the information contain ed within the array. In the example above for an array, the only information stored is the student name and the student's overall score. A record would be used this system to permanently store a student's sub-subject scores. This would allow for incomplete sub-subject areas, whereas the student's overall score stored in the array would not take incomplete sub-subject areas into account.
A list would keep track of how a student will progress through a particular subject are a. There will be sequences defined specific to the student being tutored according to previous scores. For example, the system could make an intelligent decision to eliminate a sub-subject area from being covered because the student scored above 90% in that area, therefore this sub-subject area would not be contained in the list.
Prompts for a user of this system would be stored in character strings. Users unfamiliar with the software would benefit from a prompt to save their work before leaving the tutorial if they had not previously done so.
Pointers in this system would be used to provide a method of dynamic storage management. Pointers would be used to specify the memory location of the current list the student is working on.
Sets will be used in this intelligent tutoring system to store profiles. A unique profile would consist of the lists that the student would be guided through after accessin g the subject areas the student needs to review.
Files will be used to store the student's information while they are not currently accessing the system.
Variant records will be useful for evaluating the success of the intelligent tutoring system. Records could be manipulated using the case statement to gather the data to determine whether the system is successful or unsuccessful.
Data Structures and Other Objects Using C++, Michael Main and Walter Switch
The HandBook of Software for Engineers and Scientists, Paul W. Ross
How to Program C++, Deitel & Deitel
Concepts of Programming Languages, Robert W. Sebesta