1. A loop that executes a specific number of times is called a _____

advertisement
1. A loop that executes a specific number of times is called a _____ loop.
A. endless B. Infinite C. do while D. counted
http://www.suite101.com/content/loops-a1021
2. The prefix and postix operators are _____ operators
A. boolean B. binary C. unary D. accumulating
3. A single execution of any loop is called
A. a looping B. an iteration C. infinite D. finite
4. What method is included in the java.lang package that allows the programmer to include a pause in
the program? A. rest () B. pause () C. wait () D. sleep ()
http://www.java-tips.org/java-se-tips/java.lang/pause-the-execution.html
5. The value that a user must supply to stop a loop is called a/an
A. end statement B. sentinel value C. test character D. conditional character
6. An operator that works on 2 values is a _____ operator. A. unary B. conditional C. arithmetic D. binary
7. A for loop with no body will cause a/an A. run-time error B. intentional delay in program execution C.
compiler error D. infinite loop
8. Increasing a variable’s value by one is known as _____ the variable A. incrementing B. fixing C.
decrementing D. accumulating
9. The operator that returns the remainder in a division problem is the _____ operator.
A. postfix B. % C. $$ D. rem
10. An alternative to a series of nested IF statements is the use of the A. switch statement B. case
statement C. and operator D. assignment operator
11. An operator that works on only one value is called a/an _____ operator A. unary B. conditional C.
concatenation D. binary
12. What operator is used to carry out an action if only one of the two conditions is true
A. && B. != C. || D. %
13. A program that accepts input values at runtime is a/an
A. exception B. interactive program C. userInput echo program D. single-alternative program
14. A loop that initializes, tests, and increments in one statement is a _____ loop
A. do. . .while B. do. . . Until C. for D. unary
15. The method System.in.read() : accepts a/an A. integer value from the keyboard and returns a byte
value B. char from the keyboard and returns an integer value C. byte from the keyboard and returns an
integer value D. byte from the keyboard and returns a boolean value
http://www.javaworld.com/javaworld/jw-03-2001/jw-0302-java101.html
16. A loop that checks the bottom of the loop after each repetition has occurred is called a/an _____
loop. A. if else B. do. . .until C. do. . .while D. for
17. The statement ++value is what kind of statement? A. Prefix ++ B. Postfix ++ C. Binary D.
Accumulating
18. The block of statements that executes when a loop evaluates as true is known as the A. loop body B.
conditional loop C. unary operator D. loop control variable
19. A loop controlled by the user is a/an _____ loop A. for B. infinite C. indefinite D. while
20. Two java programming students are discussing loops. Student A says that infinite loops continue on
forever, and that nothing except hitting the Ctrl + C combination can ever stop them. Student B says that
an infinite loop will eventually stop on its own, with no user intervention. Which student is correct? A.
Student A B. Student B C. Student A and Student B D. Neither student is correct
Download