I have a variable named int tripHours. The number of hours is suppose to be at least one and less than 10,000 and if it is not there should be a statement that gives an error message. How would i write that into my program?
So far I have...
int tripHours;
cout<< "Enter the number of hours for the delivery trip.";
cin>> tripHours;
...after that what should i put so that triphours is at least one and less then 10,000?
I got it so that the correct error message appears when a wrong number is entered, but if the user enters a wrong number i dont want the program to end. I need it to run "Enter the number of hours for the delivery trip." again every time a wrong answer is giving. Any help on how to do that would be appreciated.