< previous page
page_761
next page >
Page 761
answer the following questions:
a. What is the number of rows in
tickets
?
b. What is the number of columns in
tickets
?
c. How many components does
tickets
have?
d. What kind of processing (row or column) would be needed to total the ticket sales by weeks?
e. What kind of processing (row or column) would be needed to total the ticket sales by teams?
2. Given the declarations
const int NUM_SCHOOLS = 10;
const int NUM_SPORTS = 3;
enum SportType {FOOTBALL, BASKETBALL, VOLLEYBALL};
int kidsInSports [NUM_SCHOOLS][NUM_SPORTS] ;
float costOfSports[NUM_SPORTS][NUM_SCHOOLS];
answer the following questions:
a. What is the number of rows in
kidsInSports?
b. What is the number of columns in
kidsInSports?
c. What is the number of rows in
costOfSports?
d. What is the number of columns in
costOfSports?
e. How many components does
kidsInSports
have?
f. How many components does
costOfSports
have?
g. What kind of processing (row or column) would be needed to total the amount of money spent on each sport?
h. What kind of processing (row or column) would be needed to total the number of children participating in sports at a particular school?
3. Given the following code segments, draw the arrays and their contents after the code is executed. Indicate any undefined values with the letter
U.
a. int exampleA[4][3];
int i, j;
for (i = 0; i < 4; i++)
for (j = 0; j < 3; j++)
exampleA[i] [j] = i * j;
b. int exampleB[4][3];
int i, j;
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++)
exampleB[i][j] = (i + j) % 3;
< previous page
page_761
next page >