Test help! Question 7. 7. (TCO 1) What is the output for the following code frag
ID: 3553445 • Letter: T
Question
Test help!
Question 7.7. (TCO 1) What is the output for the following code fragment?
int var1 = 20;
cout << var1--;
cout << var1++;
(Points : 5)
1920
1921
2020
2019
Question 8.8. (TCO 1) Which operation in the following expression will be performed first?
c = a++ / b + 5;
(Points : 5)
a++
a / b
b + 5
assignment to c
Question 9.9. (TCO 2) The endl manipulator _______. (Points : 5)
requires #include <iomanip>
is used with cout to display a new line
only works with cin statements
All of the above
Question 10.10. (TCO 2) The users of your C++ program complain that the program's window exits before they have a chance to view the results. How can you remedy this problem? (Points : 5)
Add "cin.ignore(2)" to the end of the program's code
Add "cout.putback(2)" to the last line of code
Add "endl" to the end of the last line of code
Add "cin.get(2)" to the end of the program's code
Question 11.11. (TCO 2) Which statement outputs a double value in a field of five characters with two digits after the decimal point? (Points : 5)
cout << 5chars << 2digits << 1.23;
cout << setprecision(2) << setw(5) << 1.2345678;
cout << fixed << setprecision(2) << 1.23;
cout >> setw(2) >> setprecision(5) >> 1.23;
(TCO 2) What are the values of the variables after the code fragment below executes if the input data is 37 86.56 32?
double x, y;
int z;
cin >> x;
cin >> z;
cin >> y;
(Points : 5)
x = 37.0, y = 32, z = 86
x = 37.0, y = 56, z = 86
x = 37.0, y = 32, z = 86.56
x = 37.0, y = 0.56, z = 86
Question 7.7. (TCO 1) What is the output for the following code fragment?
int var1 = 20;
cout << var1--;
cout << var1++;
(Points : 5)
1920
1921
2020
2019
Explanation / Answer
2019
a / b
is used with cout to display a new line
Add "cin.get(2)" to the end of the program's code
cout >> setw(2) >> setprecision(5) >> 1.23;
x = 37.0, y = 32, z = 86
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.