I am writing a program for my programming class. For one program we were to create an amortized loan program, and on one part we were to make it so that the user can't enter a payment lower than we calculate their minimum to be.
I have the program written, and it executes great.
I used a while loop to handle monthly payments that were to low, uses nested if/else. But for some reason the program can't handle if the calculated minimum payment is equal to the users input for their payment. It will keep outputting telling them there payment is to low.
I even tried adding in a separate else if statement just to handle when the minimum payment equals the entered monthly payment.
1 2 3 4 5 6 7 8 9 10 11 12 13
while (true)
{
cout << "\nEnter monthly payment" << endl;
cin >> p;
if (p>=mp) break;
else
{
cout << "Your minimum payment has not been met.\n";
cout << "Please input a payment of equal or greater value to " << mp << endl;
continue;
}
}
if the entered monthly payment happens to be equal to the calculated minimum payment, mp then the output is as follows...
Your minimum payment has not been met.
Please input a payment of equal or greater value to "mp"
Enter monthly payment