This is only a section of my code the entire code is 400 plus lines. If need be I will post the entire code.
void differenceCalculator()
{ int choice, compare;
const int min = 1, max = 2;
cout << "Would you like to verify or validate the 15 or 30 year amortization table? Enter 'Y' or 'N' \n";
if (compare = 'Y' || compare 'y')
{
cout << "1. 15 year amortization table. \n";
cout << "2. 30 year amortization table. \n";
cout << "Please select from one of the options above: ";
cin >> choice;
while (choice < min || choice > max)
{
cout << "The only valid choices are " << min << " to " << max << ". Please re-enter. " << endl;
cin >> choice;
}
}
else
cout << "Returning to main menu. \n";
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.