A) do…while
B) loop
C) switch
D) for
Correct Answer
verified
True/False
Correct Answer
verified
True/False
Correct Answer
verified
Multiple Choice
A) The break statement is used to exit a repetition statement early and continue execution after the loop.
B) A break statement can only break out of an immediately enclosing while, for, do…while or switch statement.
C) The break statement, when executed in a while, for or do…while, skips the remaining statements in the loop body and proceeds with the next iteration of the loop.
D) Common uses of the break statement are to escape early from a loop or to skip the remainder of a switch.
Correct Answer
verified
True/False
Correct Answer
verified
Multiple Choice
A) strings can be used in switch expressions, but string literals cannot be used in case labels.
B) strings cannot be used in switch expressions, but string literals can be used in case labels.
C) strings can be used in switch expressions, and string literals can be used in case labels.
D) strings cannot be used in switch expressions, and string literals cannot be used in case labels.
Correct Answer
verified
True/False
Correct Answer
verified
True/False
Correct Answer
verified
Multiple Choice
A) Structured programming produces programs that are easier to test.
B) Structured programming requires four forms of control.
C) Structured programming produces programs that are easier to modify
D) Structured programming promotes simplicity.
Correct Answer
verified
Multiple Choice
A) placing control statements within each other
B) placing control statements one after another
C) reducing the number of statements required by combining statements
D) None of the above.
Correct Answer
verified
True/False
Correct Answer
verified
True/False
Correct Answer
verified
True/False
Correct Answer
verified
Multiple Choice
A) multiple initialization expressions
B) multiple increment expressions
C) multiple initialization expressions and/or multiple increment expressions
D) neither multiple initialization expressions nor multiple increment expressions
Correct Answer
verified
Multiple Choice
A) int total = 0;
for (int i = 20; i < 0; i += 1)
{
total += i;
}
B) int total = 0;
for (int i = 0; i <= 20; total += i, i += 2) ;
C) int total = 0;
for (int i = 0, i <= 20, total += i; i += 2) ;
D) int total = 0;
for (int i = 2; i < 20; total += i, i += 2) ;
Correct Answer
verified
Multiple Choice
A) classwide
B) dot (.)
C) console
D) static
Correct Answer
verified
True/False
Correct Answer
verified
Multiple Choice
A) The condition (gender == FEMALE) is evaluated first and the evaluation stops immediately.
B) The condition (age >= 65) is evaluated first and the evaluation stops immediately.
C) Both conditions are evaluated, from left to right.
D) Both conditions are evaluated, from right to left.
Correct Answer
verified
True/False
Correct Answer
verified
Multiple Choice
A) The continue statement is used to exit a repetition statement early and continue execution after the loop.
B) The continue statement is used to continue after a switch statement.
C) The continue statement does not alter the flow of control.
D) A continue statement proceeds with the next iteration of the immediately enclosing while, for, do…while statement.
Correct Answer
verified
Showing 1 - 20 of 66
Related Exams