logo

CuriousTab

CuriousTab

Object Oriented Programming Using C++ problems


  • 1. Which of the following statements allows the user to enter data at the keyboard?

  • Options
  • A. cin << currentPay;
  • B. cin >> currentPay;
  • C. cout << currentPay;
  • D. cout >> currentPay;
  • E. None of the above
  • Discuss
  • 2. To enter a comment in a C++ program, you begin the comment with _____

  • Options
  • A. **
  • B. &&
  • C. \\
  • D. @
  • E. //
  • Discuss
  • 3. A function that returns no values to the program that calls it is _____

  • Options
  • A. not allowed in C++
  • B. type void
  • C. type empty
  • D. type barren
  • Discuss
  • 4. Evaluate the following expression: 3 >6&&7>4

  • Options
  • A. True
  • B. False
  • Discuss
  • 5. Header files often have the file extension _____

  • Options
  • A. .H
  • B. .HE
  • C. .HEA
  • D. .HEAD
  • Discuss
  • 6. If you design a class that needs special initialization tasks, you will want to design a(n) _____

  • Options
  • A. housekeeping routine
  • B. initializer
  • C. constructor
  • D. compiler
  • Discuss
  • 7. Which of the following assigns the number 5 to the area variable?

  • Options
  • A. area 1 = 5
  • B. area = 5
  • C. area == 5
  • D. area --> 5
  • E. area < > 5
  • Discuss
  • 8. The keyword used to define a structure is _____

  • Options
  • A. stru
  • B. stt
  • C. struct
  • D. structure
  • Discuss
  • 9. A C++ program contains a function with the header int function(double d, char c). Which of the following function headers could be used within the same program?

  • Options
  • A. char function(double d, char c)
  • B. int function(int d, char c)
  • C. both (a) and (b)
  • D. neither (a) nor (b)
  • Discuss

First 2 3 4 5