C++ Computer Programming Language Online Test - Set 04 - ObjectiveBooks

C++ Computer Programming Language Online Test - Set 04

Practice Test: Question Set - 04

1. 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)

2. An expression contains relational, assignment and arithmetic operators. In the absence of parentheses, the order of evaluation will be
    (A) Assignment, relational, arithmetic
    (B) Arithmetic, relational, assignment
    (C) Relational, arithmetic, assignment
    (D) Assignment, arithmetic, relational

3. When the function int someFunction(char c) throw( ) is executed, ________
    (A) It can throw anything
    (B) It may throw an integer
    (C) It may throw a character
    (D) It may not throw anything

4. Static variables are sometimes called
    (A) Class variables
    (B) Functional variables
    (C) Dynamic variables
    (D) Auto variables

5. The keyword virtual indicates that
    (A) A derived class has public access to a base class
    (B) More than one base class exists
    (C) A base class should be used only once in inheritance
    (D) A derived class should have more than one base class constructed

6. When a class is derived from another derived class, the newly derived class
    (A) May have more liberal access to a base class member than its immediate predecessor
    (B) May have the same type of access to a base class member as its immediate predecessor
    (C) May have more limited access to a base class member than its immediate predecessor
    (D) Both (b) and (c)

7. Which of the following statements opens a file named temp.dat for output?
    (A) outFile.open("temp .dat");
    (B) fileOut.output("temp .dat");
    (C) openFile.out("temp .dat");
    (D) fileOpen.out("temp .dat");

8. The comma operator (,) is primarily used in conjunction with
    (A) 'for' statement
    (B) 'if-else' statement
    (C) 'do-while' statement
    (D) None of the above

9. If you omit any constructor argument when you instantiate an object, you must use default values_______
    (A) For all parameters to the constructor
    (B) For all parameters to the right of the argument
    (C) For all parameters to the left of the argument
    (D) For no other parameters

10. A class D can be derived from a class C, which is derived from a class B, which is derived from a class A
    (A) True
    (B) False

11. To hide a data member from the program, you must declare the data member in the _______ section of the class
    (A) Concealed
    (B) Confidential
    (C) Hidden
    (D) Private

12. Which (if any) of the following is NOT a programmer-defined type
    (A) An array
    (B) A structure
    (C) A class
    (D) All of the above are programmer-defined types

13. The operator that allocates new memory is _______
    (A) allocate
    (B) mem
    (C) new
    (D) next

14. The null character needs a space of
    (A) Zero bytes
    (B) One byte
    (C) Three bytes
    (D) Four bytes

15. Using new may result in less _______ memory than using an array
    (A) Wasted
    (B) Used
    (C) RAM
    (D) ROM

Show and hide multiple DIV using JavaScript View All Answers

 Next Tests:

    Blogger Comment
    Facebook Comment