Object Oriented Programming Using C++ – Section 10

1. The main difference in operation between an ‘if statement and a ‘while’ statement is

A. the ‘while’ loop body is executed
B. the body of the ‘while’ statement may be executed many times, the body of the ‘if statements only once
C. the conditional expression following the keyboard is evaluated differently
D. All of the above
E. None of the above

Correct Answer:   B. the body of the ‘while’ statement may be executed many times, the body of the ‘if statements only once
Advertisement

2. If a class object is thrown with a throw statement, then a subsequent catch block has a usable match if the type of the catch argument is_________

A. a parent class of the thrown class
B. a child class of the thrown class
C. either (a) or (b)
D. neither (a) nor (b)

Correct Answer:  A. a parent class of the thrown class
Advertisement

3. The weakest form of cohesion is

A. coincidental
B. functional
C. logical
D. communicational

Correct Answer:  A. coincidental
Advertisement

4. The ‘continue’ statement is used to

A. permit two different expressions to appear in situations where only one expression would ordinarily be used
B. terminate loops or to exit from a switch
C. alter the normal sequence of program execution by transferring control to some other part of the program
D. All of the above
E. None of the above

Correct Answer:  E. None of the above
Advertisement

5. The ‘break’ statement is used to exist from

A. a do loop
B. a for loop
C. a switch statement
D. All of the above
E. None of the above

Correct Answer:  D. All of the above
Advertisement

Leave A Comment?