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

10. (TCO 2) A user inputs his name in response to a prompt for a numeric value.

ID: 3657558 • Letter: 1

Question

10. (TCO 2) A user inputs his name in response to a prompt for a numeric value. The subsequent cin statement tries to get a numeric value and store it into an integer variable. How does a program detect this input error and clear it? (Points : 5) The cin input stream is broken, the application must be restarted. cin.fail() detects a failure and cin.clear() clears the failure. Use cin.fail() to detect the failure and cin.ignore() to clear the failure. Use cin.ignore() to detect and clear the failure.

Explanation / Answer

so simple (c)