Answer the following statements true (T) or false (F)

1. Counter-controlled repetition requires only a control variable, an initial value for the control variable and an increment or decrement.
2. Counting loops should be controlled with whatever data type most closely reflects the operations taking place, whether that is an Integer, Single or Double.
3. A control variable that is declared in a For…Next statement header may not be used outside of the body of the For…Next statement.
4. The control variable of the For…Next statement must have its type declared before or at the beginning of the loop.
5. The Visual Basic operator ^ can be used for exponentiation.

1. False. Counter-controlled repetition also requires a loop-continuation condition to determine whether the loop should continue executing the statements in its body.
2. False. Integers should be used to control counting loops, because the approximate nature of floating-point values may prevent loop-continuation conditions from evaluating correctly.
3. True.
4. False. The control variable can be used without its type being declared through local type inference (the initialization statement implies the variable’s type).
5. True.

Computer Science & Information Technology

You might also like to view...

The joining of two strings together to form a new string is called

(A) concatenation. (B) addition. (C) compaction. (D) substrings.

Computer Science & Information Technology

A ____________________ is a complex software system that controls the organization, storage, management, and retrieval of data in a database.

A. database management system B. disk C. database D. file cabinet E. none of the above

Computer Science & Information Technology