Question: Answer the quesions for the following c++ worksheet 1. Write an array declaration for each of the following: a. A list of 15 integer Student

Answer the quesions for the following c++ worksheet

1.Write an array declaration for each of the following:

a. A list of 15 integer Student ID numbers

b. A list of 20 double-precision averages

c. A list of 25 characters, each representing a student letter grade

2. Given the following array declaration/initialization:

double scores[5] = { 25.5, 35.5, 45.5, 55.5, 35.5 };

What would be displayed by the following statements?

cout << scores[3]; //answer: ______________________________

cout << scores[1]; //answer:_______________________________

3. Given the following array declaration/initialization:

char name[10] = { 'J' , 'o', 'h', 'n', ' ', 'S', 'm', 'i', 't', 'h'};

What output is produced by the following segments of code?

a.

for(int j = 0; j < 10; j++)

cout << name[j];

cout << endl;

b.

for(int j = 0; j < 10; j+=3)

cout << name[j] << ;

c.

for(int m = 9; m >= 0; m--)

cout << name[m];

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!