Counter-controlled repetition is also known as:

A. definite repetition.

B. indefinite repetition.

C. multiple-repetition structure.

D. double-repetition

Which primitive type can hold the largest value?

A. int

B. long

C. float

D. double

An algorithm is used for solving a problem in terms of the ______to execute.

A. pseudocode

B. increment

C. order

D. action

The if and if/then/else statements are an example of a ______structure.

A. sequential

B. sequence

C. selection

D. repetition

For the following code, if the value of x = 85, what value is printed?

Console.WriteLine(x<70 ? "red" : "blue");

A. "blue"

B. "red"

C. "red:blue"

D. Nothing, an error will occur.

For the following code, if the value of x = 5, what value is printed?

Console.WriteLine(x<=5 ? "red" : "blue");

A. "blue"

B. "red"

C. "red:blue"

D. Nothing, an error will occur.

For the following code, what value is printed to the user?

“ int x = 10;

x++;

Console.WriteLine(x);

A. 9

B. 10

C. 11

D. 12

For the following if statements, what value is printed if x = 8?

“ if (x<=2)

Console.WriteLine("A");

else {

if (x >= 2)

Console.WriteLine("B");

else if (x >= 4)

Console.WriteLine("C");

else

Console.WriteLine("D");

}

A. "A"

B. "B"

C. "C"

D. "D"

Which of the following is NOT an algorithm?

A. A recipe

B. Operating instructions

C. Textbook index

D. Shampoo instructions (lather, rinse, repeat)

For the following while loop, what will the final value of c be?

“ int c = 12;

int d = 5;

while (c < d)

{

c = c * 10;

}

A. 5

B. 10

C. 12

D. 20

For the following if statements, what value is printed if x = 8?

“ if (x<=2)

Console.WriteLine("A");

else {

if (x<=2)

Console.WriteLine("B");

else if (x >= 4)

Console.WriteLine("C");

else

Console.WriteLine("D");

}

A. "A"

B. "B"

C. "C"

D. "D"

An algorithm is a(n) ______that solves a particular problem or serves a particular purpose.

A. pseudocode

B. procedure

C. operator

D. decrement

For the following code, what value is printed to the user?

“ int x = 10;

Console.WriteLine(x++);

A. 9

B. 10

C. 11

D. 12

Pseudocode is most comparable to which of the following languages?

A. C#

B. C

C. Pascal

D. English

Iteration and loop statements are examples of ______structures.

A. sequential

B. sequence

C. selection

D. repetition

A programmer created a while loop in C# but failed to provide an action in the while statement, which caused the condition of the while statement to return false. What will the result be?

A. A compiler error

B. An infinite loop

C. Code execution stops after 100 loops based on the debugger settings

D. True

For the following code, what is the resulting value of z?

“ double z;

int x = 10;

int y = 4;

z = x / y;

A. 2.00

B. 2.50

C. 10

D. An error

For the following code, what value is printed to the user?

“ int x = 10;

Console.WriteLine(--x);

A. 9

B. 10

C. 11

D. 12

Which of the following is an informal type of code that can be used to develop algorithms?

A. Pseudocode

B. Procedure

C. Operator

D. Decrement

What kind of language is pseudocode?

A. A hybrid language of all .NET languages

B. An artificial language used to develop algorithms

C. A language used to translate from C++ to C#

D. None of the above

What is the Windows key sequence for typing the end-of-file indicator in Command Prompt window?

A. <Alt>z

B. <Ctrl>z

C. <Windows>z

D. <Shift>z

In a switch statement, the ______case will execute code when no match occurs between the switch's expression label and the case label.

A. default

B. continue

C. break

D. XOr

Which case of the following would warrant using the boolean logical inclusive OR (|) rather than the conditional OR (||)?

A. Testing if two conditions are both true

B. Testing if at least one of two conditions is true

C. Testing if at least one of two conditions is true when the right operand has a required side effect

D. Testing if at least one of two conditions is true when the left operand has a required side effect

Control-statement stacking is the process of:

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

The loop body of a do…while statement always executes:

A. zero times.

B. at least once.

C. more than once.

D. undeterminable

The for loop header has three items specified: control variable initialization, the loop continuation condition, and ______of the control variable.

A. increment/decrement

B. looping

C. switch

D. break

Which is equivalent to if ( !( grade == sentinelValue ) )?

A. if ( grade !== sentinelValue )

B. if ( grade != sentinelValue )

C. if ( grade == sentinelValue )

D. if ( grade !== sentinelValue )

In a switch statement, the programmer can terminate execution within the executing case by using the ______statement.

A. default

B. continue

C. break

D. XOr

The conditional OR operator is represented by which of the following?

A. &

B. |

C. ||

D. ^

The programmer can perform different actions based on the value of an expression in a ______statement.

A. for

B. case

C. do while

D. switch

The first line of the for statement is sometimes called the ______header.

A. for statement

B. increment

C. repetition

D. default

The | and & operators will ______evaluate all operands in a conditional statement.

A. never

B. always

C. conditionally

D. prematurely

Assuming a is a bool with a value of false, which of the following evaluates to true?

A. !(!a)

B. a

C. !a

D. !a!

The & and & operators will ______evaluate all operands in a conditional statement.

A. never

B. always

C. conditionally

D. prematurely

The Boolean logic OR operator is represented by which of the following?

A. &

B. &

C. ||

D. |

Which of the following statements about the break statement is FALSE?

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.

When attempting to use a for statement's control value after the loop’s body, what will the result be?

A. A compiler error

B. An infinite loop

C. Code execution stops after 100 loops based on the debugger settings

D. True

The exclusive OR operator is represented by which of the following?

A. ^

B. !

C. $

D. @

A programmer created a while loop in C#, but failed to provide an action in the while statement, which caused the condition of the while to return false. What will the result be?

A. A compiler error

B. An infinite loop

C. Code execution stops after 100 loops based on the debugger settings

D. True

In a loop, the programmer can continue execution within the executing block of code, but skip all remaining lines and simply return to the loop continuation test by using the ______statement.

A. default

B. continue

C. break

D. XOr