I need some help with this program that converts inches to centimeters.. I pretty much have the program all figured out except for one detail.. when the user inputs the low inch value, the high inch value they enter next cannot be more than 36 of the low value. How can i get the program to display an error message and ask the user to input a number only 36 larger or less than the low value?
int main ()
{
//No Local constants
double counter = 0; //While Loop counter
char RunAgain = 'Y'; //ask to run program again
//Local variables
int beginValue; //beginning value of inches
int endValue; //end value of inches
/*************** Begin main Function Executables *****************/
//Clear the screen
system ("cls");
while (RunAgain == 'y' || RunAgain == 'Y')//program runs again if y, Y entered
{
cout << "Enter low INCH value: ";//asks user to input low range value
cin >> beginValue;//store low range value
cout << "Enter high INCH value: ";//asks user to input high range value
cin >> endValue; //store high range value
if ((beginValue / 6) > 1)
{
beginValue = beginValue - (beginValue / 6);//intervals of 6
}
thanks.. it prints out error, but continues to print out the information after... i want it to print out error and loop back to asking for the inputs again... any suggestions?