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

CSE :: Object Oriented Programming Using C++

  1. To use the this pointer with a member function, you _____

  2. A.
    declare this as static
    B.
    declare this as global
    C.
    define this as equal to the address of the appropriate object
    D.
    do nothing; it is automatically supplied for you

  3. A function that is prototype as int calculate(int num); may

  4. A.
    receive an integer variable named num from the main() program
    B.
    receive any integer variable from the main() program
    C.
    either (a) or (b)
    D.
    neither (a) nor (b)

  5. A do-while loop contains

  6. A.
    only one statement between the do statement and the while statement
    B.
    several statements between the do statement and the while statement
    C.
    no statement at all between the do statement and the while statement
    D.
    only two statement between the do statement and the while statement
    E.
    None of the above

  7. The braces that surround the code in a 'C program

  8. A.
    show what code goes in a particular function
    B.
    delimit a section of code
    C.
    separate the codes from the constant
    D.
    separate the source file from the subject file
    E.
    None of the above

  9. The indirection operator is the

  10. A.
    asterisk
    B.
    ampersand
    C.
    dollar sign
    D.
    plus sign

  11. Local variables _____

  12. A.
    are created outside a block
    B.
    are known only to that block
    C.
    continue to exist when their block ends
    D.
    are illegal in C++

  13. # directives must be present

  14. A.
    before the main() function
    B.
    after the main() function
    C.
    at the end of the program
    D.
    anywhere in the program body
    E.
    None of the above

  15. Programmers prefer to declare almost all variables _____

  16. A.
    at the beginning of each function
    B.
    globally
    C.
    on one line
    D.
    with cryptic names

  17. A(n) _____ is always incremented by a constant amount, whereas a(n) _____ is incremented by an amount that varies

  18. A.
    accumulator, counter
    B.
    counter, accumulator

  19. The C++ _____ function generates random numbers

  20. A.
    generate()
    B.
    genRand
    C.
    rand
    D.
    randGen
    E.
    srand