The following statement where T is true and F is false T&&T||F&&T
A. is true
B. is false
C. is wrong
D. not applicable in C language
E. None of the above
Select an option to see the answer and solution.
Which of the following statements declares a variable that can contain a decimal number?
A. dec payRate;
B. dec hourlyPay
C. float payRate
D. float hourlyPay;
E. None of the above
Select an option to see the answer and solution.
The statement int num[2][3] = {{1,2}, {3,4}, {5, 6}};
A. assigns a value 2 to num[1][2]
B. assigns a value 4 to num[1][2]
C. gives an error message
D. assigns a value 3 to num[1][2]
Select an option to see the answer and solution.
A program will have one function prototype for each function defined in the programmer-defined section of the program. (Assume that the programmer-defined section is located below the main function.)
Select an option to see the answer and solution.
The standard input stream, which refers to the keyboard, is called
A. cin
B. cout
C. stin
D. stout
E. None of the above
Select an option to see the answer and solution.
If the code and fee arrays are parallel, the fee that corresponds to the code stored in the code[3] element is located in the _____ element
A. code[2]
B. code[3]
C. fee[2]
D. fee[3]
Select an option to see the answer and solution.
Access specifiers are followed by
A. a comma
B. a semicolon
C. a colon
D. two colons
Select an option to see the answer and solution.
Elements in an array are identified by a unique _____
A. data type
B. order
C. subscript
D. symbol
Select an option to see the answer and solution.
To include the double quotes as part of the control string we use the symbol
A. %"
B. ""
C. \"
D. #
E. None of the above
Select an option to see the answer and solution.
A C++ statement must end in a
A. : (column)
B. , (comma)
C. . (period)
D. ; (semicolon)
Select an option to see the answer and solution.
Student senior(); is a(n)_________
A. constructor call with no arguments
B. object instantiation
C. constructor call with all default arguments
D. prototype for a function that returns a student object
Select an option to see the answer and solution.
The statement int n[4] = {11, -13, 17, 105};
A. assigns the value -13 to [2]
B. assigns the value 17 to n[2]
C. is wrong; it gives an error message
D. assigns the value 18 to n[2]
Select an option to see the answer and solution.
Programmer-defined functions can be
A. value-returning functions only
B. void functions only
C. either value-returning or void functions
D. None of the above
Select an option to see the answer and solution.
A class D can be derived from a class C, which is derived from a class B, which is derived from a class A
Select an option to see the answer and solution.
To use the strcpy function, you must include the _____ header file in your program
A. assign.h
B. copy.h
C. string.h
D. strcopy.h
E. strcpy.h
Select an option to see the answer and solution.
The number of the relational operators in the C language is
A. four
B. six
C. three
D. one
E. None of the above
Select an option to see the answer and solution.
Which of the following tells C++ to display numbers with two decimal places?
A. setdecimal(2)
B. setiosflags(2)
C. setiosflags(2.00)
D. setprecision(2)
Select an option to see the answer and solution.
A function that is called automatically each time an object is destroyed is a
A. constructor
B. destructor
C. destroyer
D. terminator
Select an option to see the answer and solution.
We can output text to an object of class ofstream using the insertion operator « because
A. the ofstream class is a stream
B. the insertion operator works with all classes
C. we are actually outputting to cout
D. the insertion operator is overloaded in ofstream
Select an option to see the answer and solution.
The operator that allocates new memory is _____
A. allocate
B. mem
C. new
D. next
Select an option to see the answer and solution.