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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started