Question 1. 1. (TCO 1) Which of the following is a valid C++ identifier? (Points
ID: 3547043 • Letter: Q
Question
Question 1.1. (TCO 1) Which of the following is a valid C++ identifier? (Points : 5)
2For1
A_+_B
Two/one
A_plus_B
Question 2.2. (TCO 1) Which of the following identifies syntax errors in programs written in a high-level language? (Points : 5)
Assembler
Compiler
Preprocessor
Linker
Question 3.3. (TCO 1) For the values given, what will c contain after executing the following?
int a = 9, b = 4, c = -1;
c = a / b - 1;
(Points : 5)
3
1.25
1
-1
Question 4.4. (TCO 1) For the values given, what will c contain after executing the following?
int a = 9, b = 4, c = -1;
c *= --b * a;
(Points : 5)
27
-36
-27
36
Question 5.5. (TCO 1) A slash sign (/) is called (Points : 5)
the separation operator.
the divide operator.
the slash operator.
None of the above
Question 6.6. (TCO 1) What is the result of 56 % 10? (Points : 5)
10
5
5.6
6
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
2021
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) When used with cout, << is called (Points : 5)
the insertion operator
the extraction operator
the assignment operator
None 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 six characters with three digits after the decimal point? (Points : 5)
cout << 6chars << 3digits << 1.234;
cout << fixed << setprecision(3) << 1.234;
cout << setprecision(3) << setw(6) << 1.2345678;
cout >> setprecision(3) >> 6chars >> 1.234;
Question 1.1. (TCO 1) Which of the following is a valid C++ identifier? (Points : 5)
2For1
A_+_B
Two/one
A_plus_B
Question 2.2. (TCO 1) Which of the following identifies syntax errors in programs written in a high-level language? (Points : 5)
Assembler
Compiler
Preprocessor
Linker
Question 3.3. (TCO 1) For the values given, what will c contain after executing the following?
int a = 9, b = 4, c = -1;
c = a / b - 1;
(Points : 5)
3
1.25
1
-1
Question 4.4. (TCO 1) For the values given, what will c contain after executing the following?
int a = 9, b = 4, c = -1;
c *= --b * a;
(Points : 5)
27
-36
-27
36
Question 5.5. (TCO 1) A slash sign (/) is called (Points : 5)
the separation operator.
the divide operator.
the slash operator.
None of the above
Question 6.6. (TCO 1) What is the result of 56 % 10? (Points : 5)
10
5
5.6
6
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
2021
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) When used with cout, << is called (Points : 5)
the insertion operator
the extraction operator
the assignment operator
None 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 six characters with three digits after the decimal point? (Points : 5)
cout << 6chars << 3digits << 1.234;
cout << fixed << setprecision(3) << 1.234;
cout << setprecision(3) << setw(6) << 1.2345678;
cout >> setprecision(3) >> 6chars >> 1.234;
Explanation / Answer
(1) A_plus_B
(2)
Preprocessor
(3)1
(4)36
(5)the divide operator.
(6)6
(7)1920
(8)a++
(9)the extraction operator
(10)Add "cin.get(2)" to the end of the program's code
(11)cout << setprecision(3) << setw(6) << 1.2345678;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.