< previous page page_827 next page >

Page 827
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
a. Assign the value of the chart member of the seventy-first element of guide to the variable aRef.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
b. Copy the first element of the token member of the chart member of the eighty-eighth element of guide to the variable aCode.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
c. Assign the value X to the first element of the twenty-third element of the token member of the chart member of the ninety-fourth element of guide.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
d. Copy the fourth element of the mapCode member of aMap to the ninth element of the twentieth element of the symbol member of aRef.
4. What are the two basic differences between a record and an array?
5. A hierarchical record structure may not contain another hierarchical record structure as a member. (True or False?)
6. If the members of a record are all the same data type, an array data structure could be used instead. (True or False?)
7. For each of the following descriptions of data, determine which general type of data structure (array, record, array of records, or hierarchical record) is appropriate.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
a. A payroll entry with a name, address, and pay rate.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
b. A person's address.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
c. An inventory entry for a part.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
d. A list of addresses.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
e. A list of hourly temperatures.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
f. A list of passengers on an airliner, including names, addresses, fare class, and seat assignment.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
g. A departmental telephone directory with last name and extension number.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
h. A street name.
8. Given the declarations
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
typedef char String20[21];

struct DateType
{
    int month;
    int day;
    int year;
};
struct InfoType
{
    String20 firstName;
    String20 lastName;
    DateType birthDate;
};

DateType today;
String20 aName;
InfoType aFriend;
InfoType self;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
show the value of each variable after the following program segment is executed.

 
< previous page page_827 next page >