|
|
 |
|
|
|
|
a. Assign the value of the chart member of the seventy-first element of guide to the variable aRef. |
|
|
|
 |
|
|
|
|
b. Copy the first element of the token member of the chart member of the eighty-eighth element of guide to the variable aCode. |
|
|
|
 |
|
|
|
|
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. |
|
|
|
 |
|
|
|
|
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. |
|
|
|
 |
|
|
|
|
a. A payroll entry with a name, address, and pay rate. |
|
|
|
 |
|
|
|
|
b. A person's address. |
|
|
|
 |
|
|
|
|
c. An inventory entry for a part. |
|
|
|
 |
|
|
|
|
d. A list of addresses. |
|
|
|
 |
|
|
|
|
e. A list of hourly temperatures. |
|
|
|
 |
|
|
|
|
f. A list of passengers on an airliner, including names, addresses, fare class, and seat assignment. |
|
|
|
 |
|
|
|
|
g. A departmental telephone directory with last name and extension number. |
|
|
|
 |
|
|
|
|
h. A street name. |
|
|
|
|
|
|
|
|
8. Given the declarations |
|
|
|
 |
|
|
|
|
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; |
|
|
|
 |
|
|
|
|
show the value of each variable after the following program segment is executed. |
|
|
|
|
|