Quadratic Program Question

My computer science teacher has instructed us to create a quadratic formula program. I am fine with everything except how to avoid this in the guidelines! Any ideas?

"c. Input Failure. It is possible that the user could type something that cin cannot convert to numeric input. If this happens, alert the user that input failure has occurred and end the program"
1
2
3
4
if(not std::cin){ //cin is in an error state
   std::cerr << "Input error\n";
   return 1;
}
you may test the reading operation if( not (std::cin>>number) )
Topic archived. No new replies allowed.