Computer Science - Object Oriented Programming Using C++
Exercise :: Object Oriented Programming Using C++ - Section 9
46. |
Which of the following statements opens a file named temp.dat for output? |
A. |
outFile.open("temp .dat"); | B. |
fileOut.output("temp .dat"); | C. |
openFile.out("temp .dat"); | D. |
fileOpen.out("temp .dat"); | E. |
out.fileOpen("temp .dat"); |
Answer: Option A
Explanation:
|
47. |
Which of the following will store the letter H in a Character variable named initial? |
A. |
initial = 'H' | B. |
initial = 'H'; | C. |
initial = "H" | D. |
initial = "H"; |
Answer: Option B
Explanation:
|
48. |
Compared with the classes from which they are derived, inherited classes may have _____ |
A. |
additional data members | B. |
additional member functions | C. |
both (a) and (b) | D. |
neither (a) nor (b) |
Answer: Option C
Explanation:
|
49. |
A class named Student must have a constructor whose name is |
A. |
Student | B. |
~Student | C. |
constructor | D. |
any legal C++ name |
Answer: Option A
Explanation:
|
50. |
To write data that contains variables of type float, to an object of type ofstream, you should use |
A. |
the insertion operator | B. |
seekg() | C. |
writeQ | D. |
put() |
Answer: Option C
Explanation:
|