int main ()
{
double l, apr;
int t;
int formula;
bool notValid;
do{
notValid=false;
cout << "\nLoan Amount: " ;
cin >> l;
if (l < 100 || l > 999999.99)
{
cout << "\nLoan amount should be between $100 and $999,999.99";
notValid=true;
}
} while (notValid);
do{
notValid=false;
cout << "\nAnnual Interest Rate: " ;
cin >> apr;
if (apr < 1 || apr > 20)
{
cout << "\nInterest rate should be between 1 % and 20%";
notValid=true;
}
} while (notValid);
do{
notValid=false;
cout << "\nNumber of Payments: " ;
cin >> t;
if (t < 5 || t > 360)
{
cout << "\nNumber of payments should be between 5 and 360 months";
notValid=true;
}
} while (notValid);