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

Please only answer if you actually know the answers. Positive rating will only b

ID: 3647817 • Letter: P

Question

Please only answer if you actually know the answers. Positive rating will only be received if answers are correct. Thanks!

16. What is true about the following statement?

out.open("values.dat", ios::app);

A. If the file already exists, its contents are preserved and all output
is written to the end of the file.
B. If the file exists, it should be replaced with a new copy of
values.dat
C. If the file exists, it can be opened but not modified
D. None of these

____ 17. Which of the following statements opens the file info.txt for
both input and output?

A. dataFile.open("info.txt", ios::in && ios::out);
B. dataFile.open("info.txt", ios::in , ios::out);
C. dataFile.open("info.txt", input || output);
D. dataFile.open("info.txt", ios::in | ios::out);

____ 18. The _________ marker is the character that marks the end of
a file, and is automatically written when the file is closed.

A. End of File (EOF)
B. No More Data (NMD)
C. Data Stream Close (DSC)
D. Data Read Stop (DRS)
E. None of these

____ 19. This state bit can be tested to see if the end of an input
stream is encountered.

A. ios::eof
B. ios::eofbit
C. ios::failbit
D. ios::badbit
E. None of these

____ 20. This member function reads a single character from a file.

A. read
B. get
C. put
D. input
E. None of these

Explanation / Answer

A. If the file already exists, its contents are preserved and all output is written to the end of the file. D. dataFile.open("info.txt", ios::in | ios::out); A. End of File (EOF) B. ios::eofbit B. get