Exam2_08.7 - 43. Customizing input/output refers to a....

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

View Full Document Right Arrow Icon
41. Assume the following code: void skip_to_int() { if(cin.fail()) { cin.clear(); char ch; while (cin >> ch) { if (isdigit(ch)) { cin.unget(); return; } } } } The purpose of the while loop in the above code is to a. consume characters in the standard input stream and return b. clear the fail state of the standard input stream c. return as soon as a non-digit is located in the standard input stream d. put all digit characters back into the standard input stream e. point the standard input stream to the first digit in the stream and return 42. An important question to repeatedly ask in software development is a. Why am I doing this? b. How can I make the code run faster? c. What do we really want the code to do? d. When is enough coding enough? e. Where is the best place to locate functions?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 43. Customizing input/output refers to a. changing default outputs to match user preferences b. changing default inputs to match user preferences c. accommodating existing file specifications d. any of the above e. none of the above 44. The endl output manipulator is equivalent to a. '\n' b. "\n" c. '\n' << flush d. flush e. all of the above 45. The setw(n) manipulator controls how much space a value takes up a. by setting a maximum of n output characters for the field width b. by setting a minimum of n output characters for the field width c. by not setting a maximum of n output characters for the field width d. by not setting a minimum of n output characters for the field width e. none of the above...
View Full Document

This note was uploaded on 02/18/2012 for the course CSCE 121 taught by Professor Walter daugherity during the Fall '09 term at Texas A&M.

Ask a homework question - tutors are online