Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. Consider the following declarations: const int CAR_TYPES = 5; const int COLOR_TYPES = 6; double sales[CAR_TYPES][COLOR_TYPES]; a. How many components does the array sales

6. Consider the following declarations:

const int CAR_TYPES = 5;

const int COLOR_TYPES = 6;

double sales[CAR_TYPES][COLOR_TYPES];

a. How many components does the array sales have?

b. What is the number of rows in the array sales?

c. What is the number of columns in the array sales?

d. To sum the sales by CAR_TYPES, what kind of processing is required?

e. To sum the sales by COLOR_TYPES, what kind of processing is required?

7. Suppose that you have the following declarations:

int times[30][7];

int speed[15][7];

int trees[100][7];

int students[50][7];

a. Write the definition of the function print that can be used to output the contents of

these arrays.

b. Write the C++ statements that calls the function print to output the contents of the

arrays times, speed, trees, and students.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions