Object Oriented Programming with c++ Exam Questions - Set 34 - ObjectiveBooks

Object Oriented Programming with c++ Exam Questions - Set 34

Practice Test: Question Set - 34

1. If an integer 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) const int &
    (B) int &
    (C) Either (a) or (b)
    (D) Neither (a) nor (b)

2. Assume that a variable will need to store only integers in the range of 1 through 20000. The most efficient data type for the variable is ________
    (A) Character
    (B) Float
    (C) Integer
    (D) Short integer

3. The keyword used to define a structure is
    (A) stru
    (B) stt
    (C) struct
    (D) unlimited

4. The number 5.5e3 is a _______ constant
    (A) Character literal
    (B) Named literal
    (C) Numeric literal
    (D) String literal

5. The set of instructions for how to tie a bow is an example of the _______ structure
    (A) Control
    (B) Repetition
    (C) Selection
    (D) Sequence

6. A default constructor ________
    (A) Takes no arguments
    (B) Has default values for all its arguments
    (C) Either (a) or (b)
    (D) Neither (a) nor (b)

7. One way pointers are useful is to refer to a memory address that has no _______
    (A) Name
    (B) Constant
    (C) Location
    (D) Field

8. Catch blocks must ________
    (A) Appear in every object-oriented program
    (B) Appear within try blocks
    (C) Appear immediately after throw statements
    (D) Appear immediately after try blocks

9. To create a template class, you begin with _________
    (A) The template definition
    (B) The keyword class
    (C) The function definitions
    (D) The keyword definition

10. The last statement in a value-returning function is always ________
    (A) };
    (B) result expression;
    (C) return;
    (D) return expression;

11. A 'C function does not contain
    (A) A function header
    (B) Argument declarations
    (C) Other 'C' functions
    (D) Function body

12. Which of the following is false?
    (A) A pointer variable contains the address of a variable in memory
    (B) You should both declare and initialize a pointer before you use it
    (C) Pointers are typically initialized to the empty string ("")
    (D) A pointer's datatype must match the datatype of the variable to which it points

13. Which is true?
    (A) A derived class may have more than one base class
    (B) A base class may have more than one derived class
    (C) Both (a) and (b)
    (D) Neither (a) nor (b)

14. You can place function templates
    (A) At the end of main()
    (B) At the start of a program above main()
    (C) In two files-one for the definition and one for the function
    (D) Any of the above

15. A program that predicts the exact sequence in which events will take place is said to be ________
    (A) Compiled
    (B) Interpreted
    (C) Procedural
    (D) Object-oriented

Show and hide multiple DIV using JavaScript View All Answers

 Next Tests:

    Blogger Comment
    Facebook Comment