Programming Quiz
- Question 1
5 out of 5 points
What will the following code print? | |||||
|
- Question 2
5 out of 5 points
The C++ ________ operator represents logical AND. | |||||
|
- Question 3
5 out of 5 points
Relational operators allow you to ________ numbers. | |||||
|
- Question 4
5 out of 5 points
In a for statement, the ________ expression is executed only once. | |||||
|
- Question 5
0 out of 5 points
A for statement contains three expressions: initialization, test, and | |||||
|
- Question 6
5 out of 5 points
True/False: Assuming goodData is a Boolean variable, the following two tests are logically equivalent. | |||||
|
- Question 7
5 out of 5 points
True/False: The following C++ test checks if the variable child is in the range 3-12. | |||||
|
- Question 8
5 out of 5 points
A trailing else placed at the end of an if/else if statement provides a default action when ________ of the if conditions is/are true. | |||||
|
- Question 9
5 out of 5 points
The ideal type of loop to use for repeating a menu is a(n) ________ loop. | |||||
|
- Question 10
5 out of 5 points
In C++ when a relational expression is false, it has the value | |||||
|
- Question 11
5 out of 5 points
What will the following code print? | |||||
|
- Question 12
5 out of 5 points
True/False: To check if a variable has a particular value, use the = relational operator, as in the statement | |||||
|
- Question 13
5 out of 5 points
True/False: The statement | |||||
|
- Question 14
5 out of 5 points
The ________ operator takes an operand and reverses its truth or falsehood. | |||||
|
- Question 15
5 out of 5 points
If a switch statement has no ________ statements, the program “falls through” all of the statements below the one with the matching case expression. | |||||
|
- Question 16
5 out of 5 points
The ________ statement causes other program statements to execute only under certain conditions. | |||||
|
- Question 17
5 out of 5 points
True/False: When a loop is nested inside another loop, the inner loop goes through all its iterations for each iteration of the outer loop. | |||||
|
- Question 18
8 out of 10 points
Using a loop, write the needed statements to print out the even numbers from 1 through 100.
The expected output should be: 2, 4, 6, 8, …, 96, 98, 100 |
|||||||
|
- Question 19
5 out of 5 points
The ++ operator | |||||
|