Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

____ 86. After a value is returned from a called function, program control rever

ID: 3627406 • Letter: #

Question

____ 86. After a value is returned from a called function, program control reverts to the ____.
a. compiler c. in-line function
b. called function d. calling function


____ 87. The value returned by a called function is ____ converted to the data type declared in the function declaration.
a. usually c. sometimes
b. always d. never


____ 88. Telling the C++ compiler that a function is ____ causes a copy of the function code to be placed in the program at the point where the function is called.
a. inline c. a called function
b. online d. a calling function


____ 89. A variable with a ____ is simply one that has had storage locations set aside for it by a declaration statement made within a function body.
a. pass by value c. local scope
b. pass by reference d. global scope


____ 90. The scope of a variable is determined by the placement of the ____ statement that reserves storage for it.
a. assignment c. comparison
b. reservation d. definition


____ 91. When the scope resolution operator is used before a variable name, the compiler is instructed to use a(n) ____ variable.
a. integer c. local
b. global d. character


____ 92. Smaller programs containing a few functions should ____ contain global variables.
a. never c. usually
b. almost never d. always


____ 93. The time dimension of a variable’s scope is referred to as the variable’s ____.
a. execution time c. lifetime
b. compile time d. processing time


____ 94. A local variable that is declared as ____ causes the program to keep the variable and its latest value, even when the function that declared it is finished executing.
a. auto c. extern
b. static d. register


____ 95. Once a global variable is created, it exists until ____.
a. control is returned to the calling function
b. the program in which it is declared is finished executing
c. control is returned to the called function
d. the computer is turned off


____ 96. The misuse of globals does not apply to ____, which typically are global.
a. arguments c. function prototypes
b. return values d. local variables


____ 97. If a(n) ____ technique is not used, rand() will always produce the same series of random numbers.
a. randomization c. seeding
b. optimizing d. efficient


____ 98. The ____ class provides a set of methods that include easy insertion and removal of characters from a string.
a. char c. exception
b. ISO d. string


____ 99. Pressing the Enter key at the terminal generates a newline character, ‘ ’, which is interpreted by getline() as ____.
a. the end of data input c. the end-of-line entry
b. the end of a block of data d. a keyboard error
____ 150. The strcopy() function causes each element of string2 to be assigned to the equivalent element of string 1 until ____ is encountered.
a. end-of-string marker c. end-of-file marker
b. newline marker d. a square bracket


____ 151. The strcmp() routine ____ one string to another.
a. copies c. appends
b. compares d. compares part of


____ 152. The declarations for the string library routines are found in the ____ header file.
a. iostream c. cstring
b. cctype d. cstdlib


____ 153. The strlen() function returns the number of ____ in its C-string parameter.
a. bits c. words
b. bytes d. characters


____ 154. The ____ function returns a nonzero number if the character is a letter; otherwise returns a zero.
a. isupper(char) c. isdigit(char)
b. islower(char) d. isalpha(char)


____ 155. atoi() is a ____ routine.
a. string conversion c. string library
b. character library d. string I/O


____ 156. A structure’s ____ consists of the symbolic names, data types and arrangement of individual data fields in the structure.
a. form c. dimension
b. contents d. size


____ 157. A C++ structure can be considered as a class that has no methods and all of whose variables are ____.
a. protected c. public
b. private d. preferred


____ 158. A C++ class can be declared as a structure that has all private data members and ____ public members
a. no c. two
b. one d. all


____ 159. The definition statement Date birth, current; reserves storage for ____.
a. two birth structure variables c. a birth and a current structure variable
b. two date structure variables d. two current structure variables


____ 160. An array of records is a homogeneous data structure whose elements are of the same ____ data type.
a. homogeneous c. integer
b. structured d. heterogeneous


____ 161. The definition PayRecord employee[10]; constructs an array of ten elements, each of which is a structure of the data type ____.
a. PayRecord c. employee
b. integer d. void


____ 162. The variable employee[2].rate refers to the ____.
a. rate member of the second employee c. employee member of the third rate
b. employee member of the second rate d. rate member of the third employee


____ 163. Complete copies of ____ member(s) of a structure can be passed to a function by including the name of the structure as an argument to the called function.
a. selected c. the last
b. the first d. all


____ 164. In allocating storage dynamically, we ____ where the computer system will physically reserve the requested number of bytes.
a. have no advance indication of c. have an approximate idea of
b. know exactly d. can accurately predict


____ 165. The set of attributes and behaviors defining a class is frequently referred to as the class’s ____.
a. interface c. environment
b. specifications d. components


____ 166. In a C++ class, a member function name ____ be the same as a data member name.
a. should not c. cannot
b. should d. can


____ 167. The private access designation used in C++ classes restricts a user from seeing how the data is actually stored and is referred to as data ____.
a. security c. enforcement
b. protection d. hiding


____ 168. Class functions declared as public ____ be called by any objects and functions not in the class.
a. can c. should not
b. cannot d. should rarely


____ 169. Whenever a new object of a class is defined, the class’s ____ function is automatically called.
a. implementation c. constructor
b. declaration d. extension


____ 170. Within the declaration section of a class definition, functions are declared via ____.
a. constructors c. initialization statements
b. assignment statements d. prototypes


____ 171. Data members of a class are also known as ____.
a. instance variables c. manipulators
b. data elements d. initializers


____ 172. If an object’s data members are assigned default values by a constructor function, those assigned values ____ be changed.
a. cannot c. should not
b. can d. should always


____ 173. If a class designates all of its data members as private and all of its member functions as public, we must rely on ____ to access data members.
a. scope resolution operators c. assignment statements
b. member functions d. equivalence statements


____ 174. Objects have the same relationship to classes as ____ do to C++ built-in data types.
a. constants c. instances
b. variables d. cases


____ 175. If no constructor is provided in a class definition, the compiler will ____.
a. supply a stub c. issue an error message
b. do nothing d. supply a do-nothing default constructor


____ 176. The term information hiding refers to the encapsulation and ____ of all implementation details.
a. encryption c. hiding
b. translation d. destruction


____ 177. Date c = Date(4,1,2007) is a valid ____ language declaration for an object of a class named Date.
a. C++ c. assembler
b. C d. machine


____ 178. The selection of an algorithm and how it will be applied to an object’s attributes are ____ issues.
a. programming c. testing
b. coding d. implementation


____ 179. To store and retrieve data outside a C++ program, two things are needed: a file and a(n) ____.
a. storage device c. file stream object
b. buffer d. I/O command


____ 180. Each file has a unique file name referred to as the file’s ____.
a. external name c. label
b. name d. mnemonic


____ 181. Each computer operating system has its own specifications as to the maximum number of ____ permitted for an external file name.
a. bits c. words
b. bytes d. characters


____ 182. A file stream that receives or reads data from a file into a program is called a(n) ____.
a. input file stream c. input command
b. input data path d. read statement


____ 183. For each file that a program uses, a distinct ____ must be created.
a. path mode c. transmission path
b. I/O stream object d. file stream object


____ 184. Text files are also known as ____.
a. binary-based files c. I/O files
b. character-based files d. stream objects


____ 185. A stream is a one-way transmission of ____ between a source and a destination.
a. bits c. bytes
b. characters d. words


____ 186. File stream objects connect a program to a ____.
a. keyboard c. storage device
b. terminal screen d. file


____ 187. The classes ifstream and ofstream are made available to a program by inclusion of the ____ header file.
a. fstream c. iofstream
b. iostream d. stream


____ 188. The advantage of binary-based files is ____.
a. accuracy c. compactness
b. ease of reading d. speed of access


____ 189. Opening a file connects each file stream object to a specific ____.
a. storage device c. register
b. external file name d. storage location


____ 190. The ____ method is used to check that a file has been successfully opened.
a. eof() c. fail()
b. good() d. bad()


____ 191. In declaring and initializing a string variable for use in an open() method, the string is always considered as a(n) ____.
a. array c. string
b. structure d. C-string


____ 192. The operating system will ____ close any open files existing at the end of program execution.
a. sometimes c. automatically
b. usually d. not


____ 193. Reading data from a character-based file is almost identical to reading data from a standard keyboard, except that the cin object is replaced by the ____ object declared in the program.
a. fstream c. iostream
b. ifstream d. ostream


____ 194. The input statement inFile >> descrip >> price; will read the next ____ items in the file.
a. two c. four
b. three d. five


____ 195. The standard input file is usually a ____.
a. printer c. modem
b. terminal d. keyboard


____ 196. As opposed to the seek() functions that move the file position marker, the ____ functions simply return the offset value of the file position marker.
a. fail() c. bad()
b. good() d. tell()

Explanation / Answer

____ 86. After a value is returned from a called function, program control reverts to the ____.
d. calling function


____ 87. The value returned by a called function is ____ converted to the data type declared in the function declaration.

b. always


____ 88. Telling the C++ compiler that a function is ____ causes a copy of the function code to be placed in the program at the point where the function is called.
a. inline

____ 89. A variable with a ____ is simply one that has had storage locations set aside for it by a declaration statement made within a function body.
local scope



____ 90. The scope of a variable is determined by the placement of the ____ statement that reserves storage for it.
definition