subject

For C++ ONLY please, Write a for loop to print all NUM_VALS elements of vector courseGrades, following each element with a space (including the last). Print forwards, then backwards. End with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print:
7 9 11 10
10 11 9 7
Hint: Use two for loops. Second loop starts with i-courseGrades. size() - 1 (Notes)
Note: These activities may test code with different test values. This activity will perform two tests, both with a 4-element vector (vector int> courseGrades(4)). See "How to Use zyBooks".
Also note: If the submitted code tries to access an invalid vector element, such as courseGrades at(9) for a 4-element vector, the test may generate strange results. Or the test may crash and report "Program end never reached', in which case the system doesn't print the test case that caused the reported message.
1 #include
2 #include
3 using namespace std; DIIDII
4
5 int maino {
6 const int NUM_VALS - 4;
7 vector int> courseGrades (NUM_VALS);
8 int i;
9
10 for (i = 0; i < courseGrades. size(): ++) {
11 cin >> courseGrades. at(i); /*
12 }
13
14 Your solution goes here */
15
16 return ;
17 }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Choose the best explanation for the following statement communication is symbolic
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
Which of the following is not a symptom of chronic fatigue syndrome
Answers: 2
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the file tab. click the file tab, then click print, or click the page layout tab. click the page layout tab, or click the review tab. click the review tab, or click the home tab?
Answers: 2
You know the right answer?
For C++ ONLY please, Write a for loop to print all NUM_VALS elements of vector courseGrades, follow...
Questions
question
Social Studies, 06.09.2021 14:00
question
Social Studies, 06.09.2021 14:00
Questions on the website: 13722367