Practice Test: Question Set - 17
1. To use one of the C++ built-in mathematical functions, you must include the _______ header file in your program
- (A) calculation.h
- (B) compute.h
- (C) expression.h
- (D) math.h
2. The expression c = i++ causes
- (A) The value of
i assigned to c and then i incremented by 1
- (B) i
to be incremented by 1 and then the value of i assigned to c
- (C) Value of i
assigned to c
- (D) i to be
incremented by 1
3. Any #include files may contain
- (A) Constants
- (B) Variables
- (C) Functions
- (D) All of the
above
4. Which of the following statements will display the word "Hello" on the computer screen?
- (A) cin <<
"Hello";
- (B) cin >>
"Hello";
- (C) cout
<< "Hello";
- (D) cout
>> "Hello";
5. A function can make________
- (A) One throw
- (B) One
throw of each scalar type
- (C) One throw of
each programmer-defined type
- (D) As
many throws of as many types as necessary
6. The getline() function reads a line of text until _______
- (A) The
length used as the second argument is reached
- (B) The
character used as the third argument is reached
- (C) Either (a)
or (b)
- (D) Neither (a)
nor (b)
7. Which of the following is a C++ object?
- (A) cin
- (B) >>
- (C) iostream
- (D) read()
8. Object-oriented programmers primarily focus on _________
- (A) Procedures
to be performed
- (B) The
step-by-step statements needed to solve a problem
- (C) Objects
and the tasks that must be performed with those objects
- (D) The
physical orientation of objects within a program
9. The two parts of a function are the
- (A) Header and
footer
- (B) Declarations
and statements
- (C) Legs and
feet
- (D) Header and
body
10. The compiler converts your C++ instructions into _______
- (A) Edited code
- (B) Object code
- (C) Source code
- (D) Translated
code
11. A function's purpose is to print customer data. Which of the following is the best name for this function?
- (A) pcd().
It's short for "print customer data" and takes few keystrokes
- (B) Printcustomerdata().
It states everything the function will do
- (C) printCustomer().
It states the function's purpose and is easy to read
- (D) lastFunction().
It is the final function called in most programs, and this name identifies the
function's timing
12. Software that can be used in applications other than the one for which it was originally written is called
- (A) Recyclable
- (B) Inherited
- (C) Reusable
- (D) Cheating
13. A normal C++ operator that acts in special ways on newly defined data types is said to be
- (A) Glorified
- (B) Encapsulated
- (C) Classified
- (D) Overloaded
14. In the expression p --> val,p is a(n)
- (A) Address
- (B) Pointer
- (C) Structure
- (D) Header
15. A class hierarchy
- (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
Next Tests: