If you're asking how to recover from a user entering non-digits when you're trying to read in an int:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
do
{
cout << "Cycle Time (in seconds, 15-20): " ;
cin >> t2 ;
if ( !cin ) // got some bad input!
{
cin.clear() ; // reset state of cin.
while (cin.get() != '\n') // clear the input in the stream.
;
}
} while (t2 > 20 || t2 < 15 ) ;
thanks cire.. u helped me alots..
my lecturer tested my program and i had this vulnerability she said she will deduct marks.. somehow i need to fix it and thanks im done with my project =D