< previous page page_761 next page >

Page 761
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
answer the following questions:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
a. What is the number of rows in tickets?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
b. What is the number of columns in tickets?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
c. How many components does tickets have?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
d. What kind of processing (row or column) would be needed to total the ticket sales by weeks?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
e. What kind of processing (row or column) would be needed to total the ticket sales by teams?
2. Given the declarations
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
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];
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
answer the following questions:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
a. What is the number of rows in kidsInSports?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
b. What is the number of columns in kidsInSports?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
c. What is the number of rows in costOfSports?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
d. What is the number of columns in costOfSports?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
e. How many components does kidsInSports have?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
f. How many components does costOfSports have?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
g. What kind of processing (row or column) would be needed to total the amount of money spent on each sport?
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
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.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
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 >