Computers and Technology, 21.01.2021 23:10 shreyasvrangan
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 }
Answers: 2
Computers and Technology, 22.06.2019 07:20, Hcalhoun21
Write a pseudocode solution for each of these problems. 1. design a while loop that lets that user enter a number. the number should be multiplied by 10, and the result stored in a variable named product. the loop should iterate as long as product contains a value less than 100. 2. design a do-while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed. the loop should ask the user whether he or she wishes to perform the operation again. if so, the loop should repeat; otherwise it should terminate. 3. design a for loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 100. 4. design a nested loop that displays 10 rows of # characters. there should be 15 # characters in each row. 5. convert this for loop to a while loop. declare integer count for count = 1 to 50 display count end for 6. find the error in the following pseudocode. declare boolean finished = false declare integer value, cube while not finished display “enter a value to be cubed.” input value; set cube = value ^ 3 display value, “ cubed is “, cube end while
Answers: 2
Computers and Technology, 23.06.2019 13:50, mrfishyyyy
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
For C++ ONLY please,
Write a for loop to print all NUM_VALS elements of vector courseGrades, follow...
English, 04.12.2020 17:40
Biology, 04.12.2020 17:40
Computers and Technology, 04.12.2020 17:40
History, 04.12.2020 17:40
Mathematics, 04.12.2020 17:40
History, 04.12.2020 17:40
Mathematics, 04.12.2020 17:40