Page 229 - ComputerScience_Class_11
P. 229
MIND DRILL
Solved Questions
A. Tick ( ) the correct option.
1. Which of the following is not a type of statement in Java?
a. Expression Statements b. Declaration Statements
c. Control Statements d. None of these
2. Which statement is used to calculate certain equations and produce a result?
a. Expression b. Declaration
c. Control d. None of these
3. Which statement in Java follows the top-down approach?
a. if-else statement b. Switch case
c. Sequential Statement d. None of these
4. Which of the following statements checks a particular condition?
a. switch case b. if statement
c. for loop d. Both a and b
5. Which of the following constructs can be used for selection?
a. for b. switch
c. if-else d. Both b and c
6. Which of the following checks the condition before executing the body of the loop?
a. Entry controlled loop b. Exit controlled loop
c. Top-down approach d. None of these
Answers
1. d 2. a 3. c 4. d 5. d 6. a
B. Fill in the blanks.
1. When a switch case is used under another switch case, it is called ………………… switch.
2. ………………… method finds the largest integer value which is less than or equal to the argument passed to it.
3. When no match is found in a switch statement, the ………………… case is executed.
4. The ………………… statement in Java is used to end the current iteration in a loop and continues the flow of the program.
5. The random() method in Java returns the random value between ………………… and ………………… .
6. The Java ………………… class contains a set of mathematical functions.
7. We use ………………… to specify a new test condition in the if statement when the first condition is false.
8. The Java ………………… loop executes a set of statements repeatedly until the specified condition is true.
Answers
1. nested 2. Math.floor() 3. default 4. continue 5. 0 and 1
6. Math 7. else-if 8. do-while
Statements and Scope 227

