< previous page page_763 next page >

Page 763
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
a. strcpy(nameList[3], oneName);
b. nameList[14][27] = z;
c. nameList[3][7] = y;
d. cin >> nameList;
e. cin >> nameList[0];
f. cin >> nameList[0][5];
7. Declare the array variables described below. Use proper style.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
a. A table with five rows and six columns that contains Boolean values. (Assume the Boolean type has been defined previously.)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
b. A table, indexed from 0 through 39 and 0 through 199, that contains float values.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
c. A char table with rows indexed by a type
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
enum FruitType {LEMON, PEAR, APPLE, ORANGE};
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
and columns indexed by the integers 0 through 15.
8. A logging operation keeps records of 37 loggers' monthly production for purposes of analysis, using the following array structure:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
const int NUM_LOGGERS = 37;

int logsCut[NUM_LOGGERS][12];  // Logs cut per logger per month
int monthlyHigh;
int monthlyTotal;
int yearlyTotal;
int high;
int month;
int bestMonth;
int logger;
int bestLogger;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
a. The following statement would assign the January log total for logger number 7 to monthlyTotal. (True or False?)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
monthlyTotal = logsCut[7][0];
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
b. The following statements would compute the yearly total for logger number 11. (True or False?)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
yearlyTotal = 0;
for (month = 0; month < NUM_LOGGERS; month++)
    yearlyTotal = yearlyTotal + logsCut[month][10];
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
c. The following statements would find the best logger (most logs cut) in March. (True or False?)

 
< previous page page_763 next page >