Home / CSE / Object Oriented Programming Using C++ :: Section 7

CSE :: Object Oriented Programming Using C++

  1. The instruction "If it's raining outside, then take an umbrella to work" is an example of the _____ structure

  2. A.
    control
    B.
    repetition
    C.
    selection
    D.
    sequence
    E.
    switching

  3. Which of the following statements will assign the address of the age variable to the agePtr pointer?

  4. A.
    agePtr = &age;
    B.
    agePtr = *age;
    C.
    &agePtr = age;
    D.
    *agePtr = age;
    E.
    agePtr -> *age;

  5. The >> (extraction) operator stops reading characters from the keyboard as soon as the user _____

  6. A.
    presses the Enter key
    B.
    types a character that is inappropriate for the variable's data type
    C.
    both (a) and (b)

  7. In the statement template<class T>,

  8. A.
    T is a class
    B.
    T is a scalar variable
    C.
    either (a) or (b)
    D.
    neither (a) nor (b)

  9. The null character is represented by

  10. A.
    \n
    B.
    \0
    C.
    \o
    D.
    \r
    E.
    None of the above

  11. The break statement is

  12. A.
    a preprocessor directive
    B.
    an operator in the C++ language
    C.
    a keyword in the C++ language
    D.
    switch in the C++ language
    E.
    None of the above

  13. A variable w with a value 67 may be defined with _______

  14. A.
    int w = 67;
    B.
    int w(67);
    C.
    int 67(w);
    D.
    both (a) and (b), but not (c).

  15. An expression contains relational, assignment and arithmetic operators. In the absence of parentheses, the order of evaluation will be

  16. A.
    assignment, relational, arithmetic
    B.
    arithmetic, relational, assignment
    C.
    relational, arithmetic, assignment
    D.
    assignment, arithmetic, relational
    E.
    None of the above

  17. The keyword virtual indicates that

  18. 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

  19. If you declare two objects as Customer firstCust, secondCust; which of the following must be true?

  20. A.
    Each object will store a separate copy of any static member data
    B.
    Each object will store a separate copy of any member functions
    C.
    Each object will store a separate copy of any nonstatic data members
    D.
    You cannot declare two objects of the same class