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

CSE :: Object Oriented Programming Using C++

  1. The purpose of a conditional operator is to

  2. A.
    select one of the two values
    B.
    select the highest of the two values
    C.
    select one of the two values depending on a condition
    D.
    select the more equal of the two values
    E.
    None of the above

  3. Which of the following, if any, are valid names for variables?

  4. A.
    amt.Sold
    B.
    amt-Sold
    C.
    amt_Sold
    D.
    98Sold
    E.
    None of the above are valid names for variables

  5. Assume you want to compare the character stored in the initial variable to the letter a. Which of the following conditions should you use in the if statement? (Be sure the condition will handle a or A.)

  6. A.
    (initial = 'a' or 'A')
    B.
    (initial == 'a' or 'A')
    C.
    (toupper(initial) = 'A')
    D.
    (toupper(initial) == 'A')

  7. You can override a class's inherited access to make an individual member's access more ______

  8. A.
    liberal
    B.
    conservative
    C.
    either (a) or (b)
    D.
    neither (a) nor (b)

  9. A class hierarchy

  10. A.
    describes "is a kind of" relationships
    B.
    describes "has a" relationships
    C.
    shows the same relationships as an organization chart
    D.
    shows the same relationships as a family tree

  11. Which of the following C++ expressions is equivalent to the mathematical expression 53 ?

  12. A.
    5 ^ 3
    B.
    cube(5)
    C.
    pow (3, 5)
    D.
    pow(5, 3)
    E.
    sqrt (5, 3)

  13. The right shift operator is represented by the symbol

  14. A.
    >
    B.
    >>
    C.
    ->
    D.
    <
    E.
    None of the above

  15. In C++, class definitions are most often

  16. A.
    stored with each program that uses them
    B.
    stored in a header file that is included in the programs that use them
    C.
    stored in a folder that you paste into every new project
    D.
    retyped for every new project