{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


Exam2_Review_Key.2 - e ofstream ost.open(“input” 11 An...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CPSC 121 Exam 2 Review Key d. Ensure that there is an appropriate number of objects in the class e. (b) and (c) are both true. 8. Consider the definition: enum day { mon, tue, wed = 5, thur, fri, sat, sun }; What is the value of sun? a. 0 b. 1 c. 6 d. 7 e. 9 9. Suppose you are trying to read data from a file, but the disk the file has been stored on has been damaged and cannot be read. You can expect the error you get to be the state 10. To create an input stream to read from file input.txt, one could use
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e. ofstream ost.open(“input.txt”); 11. An ostream a. Turns values of various types into character sequences b. Turns character sequences into values of various types c. Unlike an istream, an ostream does not use buffers, since it is bringing bytes directly into the computer there is no reason to waste the time of storing them into a buffer first. d. Sends characters somewhere, such as a console, a file, the main memory, or another computer. e. Both (a) and (d) are true 12. What is printed by cout << 123456 << “\n” << setw(4) << 123456; a. 123456 1234 b. 123456 3456 c. 123456 <Too Big> d. 123456 setw( ) will adjust the spacing for output smaller than the specified width 123456...
View Full Document

{[ snackBarMessage ]}