Object Oriented Programming c++ Questions & Answers - Set 15 - ObjectiveBooks

Object Oriented Programming c++ Questions & Answers - Set 15

Practice Test: Question Set - 15


1. When an object-oriented program detects an error within a function, the function _______
    (A) Throws an exception
    (B) Throws a fit
    (C) Catches a message
    (D) Catches an exception

2. To create a variable, you must assign _______ to it
    (A) A data type
    (B) A name
    (C) Both a data type and a name
    (D) The word var

3. An address is a _______ , while a pointer is a _______
    (A) Array, variable
    (B) Constant, variable
    (C) Variable, position
    (D) Variable, location

4. In which statements, does a 'continue' statements cause the control to go directly to the test condition and then continue the looping process?
    (A) 'for' and 'while'
    (B) 'while' and 'if-else'
    (C) 'do-while' and 'if-else'
    (D) 'while' and 'do-while'

5. The main() function is always
    (A) A called function
    (B) A calling function
    (C) Recursive function
    (D) Used at the end of the program

6. The code that you enter into a C++ program is called ________
    (A) Console code
    (B) Object code
    (C) Project code
    (D) Source code

7. A translator that notes whether you have used a language correctly may be called a _______
    (A) Theasurus
    (B) Compiler
    (C) Coder
    (D) Decoder

8. You define a structure type globally because
    (A) You save many lines of code by not rewriting an identical structure definition in each function that uses it
    (B) You will never change its definition
    (C) It is required in C++
    (D) All of the above

9. Which of the following is false?
    (A) A void function's header begins with the keyword void
    (B) A value-returning function's header begins with a data type, which represents the type of data the function will return
    (C) Assuming displayAge is the name of a void function, displayAge(); is a both logically and syntactically valid C++ statement
    (D) Assuming calcNewPrice is the name of a value-returning function, calcNewPriceO; is a both logically and syntactically valid C++ statement

10. A static data member is given a value
    (A) Within the class definition
    (B) Outside the class definition
    (C) When the program is executed
    (D) Never

11. The statement fwrite ( (char*)&objl, sizeof(objl) );
    (A) Writes the member functions of objl to fl
    (B) Writes the data in objl to fl
    (C) Writes the member functions and me data of obj 1 to fl
    (D) Writes the address of objl to fl

12. Which of the following statements is false?
    (A) A class encapsulates all of an object's attributes and behaviors
    (B) An example of an attribute is the minutes variable in a time class
    (C) A class is considered an object
    (D) An object created from a class is referred to as an instance of the class

13. Which of the following is the inequality operator?
    (A) !=
    (B) =
    (C) ==
    (D) -->

14. Which of the following is a string literal constant?
    (A) "Visual C++"
    (B) "137.45"
    (C) "A"
    (D) All of the above

15. The function that takes arguments to set the bits of count is ________
    (A) setf()
    (B) bitsef()
    (C) ios()
    (D) flag()

Show and hide multiple DIV using JavaScript View All Answers

 Next Tests: