Tables | ||||||||||||||||||||||
A table is essentially an array of records - each element of the array has a number of fields of possibly different types. A table is generally held in the computer's memory and is used to 'look up' information. A hash table is a special table which holds variable names and their addresses, so that the address of any variable can be quickly looked up. Example : A teacher might have a list of pupil names, forms and exam marks. If he wants to know what exam mark a certain pupil had, then he looks down the list of names until he finds the one he wants, then looks across to the corresponding mark. 'Marks' is a table of pupils and their exam marks.
This table has 4 records. Marks[3].Name is 'John Conrad' - a subscript and a field name is needed.
|
||||||||||||||||||||||
Exercise | ||||||||||||||||||||||
Using the table (array of records) called Marks, what would be output by the following code segments... |
||||||||||||||||||||||
|
||||||||||||||||||||||
(Green indicates success) | ||||||||||||||||||||||