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

CSE :: Object Oriented Programming Using C++

  1. Which of the following formulas can be used to generate random integers between 1 and 10?

  2. A.
    1 + rand() % (10 - 1 + 1)
    B.
    1 + (10 - 1 + 1) % rand()
    C.
    10 + rand() % (10 - 1 + 1)
    D.
    10 + rand() % (10 + 1)

  3. Format flags may be combined using the _____

  4. A.
    bitwise OR operator(|)
    B.
    logical OR operator (||)
    C.
    bitwise AND operator (&)
    D.
    logical AND operator (&&)

  5. Which of the following will store the number 320000 as a Float number?

  6. A.
    counPop = (float) 3.2e5;
    B.
    counPop = (float) 3.2e6;
    C.
    counPop = (float) .32e5;
    D.
    counPop = (float) .32e7;
    E.
    counPop = (float) 3.2-e5;

  7. The arguments that determine the state of the cout object are called

  8. A.
    classes
    B.
    manipulators
    C.
    format flags or state flags
    D.
    state controllers

  9. If a class will serve as a base class, most often the base class data members are

  10. A.
    private
    B.
    protected
    C.
    public
    D.
    polymorphic

  11. You can use the C++ _____ function to assign a value to a String variable

  12. A.
    assign
    B.
    copy
    C.
    string
    D.
    strcopy
    E.
    strcpy

  13. A measure of the strength of the connection between two functions is

  14. A.
    cohesion
    B.
    coupling
    C.
    dependence
    D.
    subjection

  15. The following statement where T is true and F is false T&&T||F&&T

  16. A.
    is true
    B.
    is false
    C.
    is wrong
    D.
    not applicable in C language
    E.
    None of the above

  17. Which of the following statements declares a variable that can contain a decimal number?

  18. A.
    dec payRate;
    B.
    dec hourlyPay
    C.
    float payRate
    D.
    float hourlyPay;
    E.
    None of the above

  19. The statement int num[2][3]={ {1,2}, {3,4}, {5, 6} };

  20. A.
    assigns a value 2 to num[1][2]
    B.
    assigns a value 4 to num[1][2]
    C.
    gives an error message
    D.
    assigns a value 3 to num[1][2]