A function that is called automatically each time an object is created is a(n)
A. constructor
B. contractor
C. builder
D. architect
Select an option to see the answer and solution.
A variable's _____ indicates how long the variable remains in the computer's memory
A. area
B. extent
C. lifetime
D. reach
E. scope
Select an option to see the answer and solution.
The function whose prototype is void getData(Item *thing); receives
A. a pointer to a structure
B. a reference to a structure
C. a copy of a structure
D. nothing
Select an option to see the answer and solution.
You may override the class access specifier for _____
A. public members
B. public and protected members
C. any specific class members you choose
D. no class members
Select an option to see the answer and solution.
The null character needs a space of
A. zero bytes
B. one byte
C. three bytes
D. four bytes
E. None of the above
Select an option to see the answer and solution.
The number of structures than can be declared in a single statement is
A. one
B. two
C. three
D. unlimited
Select an option to see the answer and solution.
The cout << sales[0] + sales[1]; statement will ______
A. display 22000
B. display 10000 + 12000
C. display sales[0] + sales[1]
D. result in an error
Select an option to see the answer and solution.
The most efficient data type for a variable that stores the letter C is the _____ data type
A. Character
B. Double
C. Float
D. Long Integer
E. Short Integer
Select an option to see the answer and solution.
The C++ operator used to allocate memory is _________
A. mem
B. allocate
C. new
D. create
Select an option to see the answer and solution.
Assume that your version of C++ can recognize only the first 8 characters of an identifier name, through identifier names may be arbitrarily long. Which of the following identifier names is not distinct:
A. list, list2
B. address, Address
C. identifier_l, identifier_2
D. answer, ANSWER
E. None of the above
Select an option to see the answer and solution.
Object is to class as _____
A. library is to book
B. mother is to daughter
C. Plato is to philosopher
D. president is to Lincoln
Select an option to see the answer and solution.
A derived class may also be called a
A. subclass
B. super class
C. parent class
D. base class
Select an option to see the answer and solution.
The C++ keyword for declaring a variable that contains a decimal point is _____
A. dec
B. decimal
C. float
D. floater
E. None of the above
Select an option to see the answer and solution.
When you define an object that is a member of a class, such as Student Abby; _____
A. a block of memory is set aside and all data members are assigned valid values
B. a block of memory is set aside
C. no memory is set aside until values are defined
D. no memory is set aside, but valid values are assigned to data members
Select an option to see the answer and solution.
A program can directly access the _____ members of a class
A. hidden
B. private
C. public
D. both (b) and (c)
Select an option to see the answer and solution.
Any output manipulator function you create _____
A. should take as an argument an instance of ostream as a reference
B. should return void
C. must be a member function of the ostream class
D. must inherit ostream
Select an option to see the answer and solution.
To pass an array by reference, you
A. must include the address-of (&) operator before the array's name
B. must include the number symbol (#) before the array's name
C. do not have to do anything because arrays are automatically passed by reference
D. None of the above
Select an option to see the answer and solution.
The instructions you enter into the computer are called the _____
A. edited code
B. machine code
C. object code
D. source code
Select an option to see the answer and solution.
The String data type is an extension of the _____ data type
A. Character
B. Double
C. Letter
D. Long
E. Text
Select an option to see the answer and solution.
An advantage of using local variables is that _____
A. they are known to all functions in the file
B. names used in one function do not affect data stored in variables with the same names in other functions
C. values given to local variables are retained when those parameters go out of scope
D. the program does not become "crowded" with too many variable names
Select an option to see the answer and solution.