In a __ control structure, the computer executes particular statements depending on some condition(s). |
c. selection |
What does <= mean? |
c. less than or equal to |
Which of the following is a relational operator? |
b. == |
Which of the following is the "not equal to" relational operator? |
c. != |
Suppose x is 5 and y is 7. Choose the value of the following expression: (x ! = 7) & & (x <= y) |
b. true |
Suppose that x is an int variable. Which of the following expressions always evaluates to true? |
a. (x > 0) I I (x <= 0) |
Which of the following operators has the highest precedence? |
a. ! |
Which of the following operators has the lowest precedence? |
d. = |
Which of the following expressions correctly determines that x is greater than 10 and less than 20? |
c. 10 < x & & x < 20 |
The expression in an if statement is sometimes called a(n) __ . |
c. decision maker |
What is the output of the following C++ code? |
b. 35 45 10 |
When one control statement is located within another, it is said to be __ . |
c. nested |
What is the output of the following code? |
a. * |
To develop a program, you can use an informal mixture of C++ and ordinary language, called __ . |
b. pseudocode |
Which of the following will cause a logical error if you are trying to compare x to 5? |
b. if (x = 5) |
The appearance of = in place of == resembles a(n) __ . |
b. silent killer |
The conditional operator ? : takes __ arguments. |
b. three |
What is the value of x after the following statements execute? |
c. 4 |
Assume you have three int variables: x = 2, Y = 6 , and z. Choose the value of z in the following expression: |
a. 2 |
What is the output of the following code? |
d. section 5 |
What is the output of the following code? |
a. section 1 |
What is the output of the following code fragment if the input value is 4? |
a. 13 |
What is the output of the following C++ code? |
a. 2 |
For a program to use the assert function, it must include which of the following? |
b. #include <cassert> |
You can disable assert statements by using which of the following? |
d. #define NDEBUG |
In __ structures, the computer repeats particular statements a certain number of times depending on some condition(s). |
a. looping |
What is the output of the following C++ code? |
d. 25 1 |
What is the output of the following C++ code? |
d. 10 |
A loop that continues to execute endlessly is called a(n) __ loop. |
c. infinite |
Assume all variables are properly declared. What is the output of the following C++ code? |
b. 155 |
Consider the following code. |
b. counter-controlled |
Suppose sum and num are int variables, and the input is 18 25 61 6 -1. What is the output of the following code? |
c. 110 |
A(n) __ -controlled while loop uses a bool variable to control the loop. |
c. flag |
Consider the following code. (Assume that all variables are properly declared.) |
c.EOF-controlled |
What is the next Fibonacci number in the following sequence? 1, 1,2,3,5,8, 13,21, ... |
a. 34 |
Which of the following is the initial statement in the following for loop? (Assume that all variables are properly declared.) |
a. i = 1; |
What is the output of the following C++ code? |
c. 10 11 |
Suppose sum, num, and j are int variables, and the input is 4 7 12 9 -1. What is the output of the following code? |
a. 24 |
Suppose j, sum, and num are int variables, and the input is 26 34 61 4 -1. What is the output of the code? |
b. 125 |
Which executes first in a do ... while loop? |
a. statement |
What is the value of x after the following statements execute? |
d. 40 |
What is the output of the following loop? |
d. This is an infmite loop. |
__ loops are called post-test loops. |
d. do ... while |
Which of the following loops is guaranteed to execute at least once? |
c. do ... while loop |
Which of the following loops does not have an entry condition? |
c. do ... while loop |
Which of the following is a repetition structure in C++? |
d. do ... while |
Which of the following is true about a do ... while loop? |
a. The body of the loop is executed at least once. |
Which of the following is not a function of the break statement? |
d. To ignore certain values for variables and continue with the next iteration of a loop |
Which executes immediately after a continue statement in a while and do-while loop? |
a. loop-continue test |
When a continue statement is executed in a __ ' the update statement always executes. |
b. for loop |