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

Info icon This 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?
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern