Escolar Documentos
Profissional Documentos
Cultura Documentos
Nathan Kondor
INFO_1522_WW
06/28/2016
C++ Programming - Program Design Including Data Structures
Chapter 5 - Exercise 21
Enhance your program from exercise 20 by first telling the user the minimum
monthly payment and then prompting the user to enter in the monthly payment.
Your last payment might be more than the remaining loan amount and interest on
it. In this case, output the loan amount before the last payment and the actual
amount of the last payment. Also, output the total interest paid.
double principle = 0;
double aPR = 0;
double mP = 0;
//Output variables
double newAPR = 0;
//APR variable for calculation
double newPrinciple = 0;
//Principle variable for calculation
double adjNewPrinciple = 0;
//Adjusted New Principle
double mPR = 0;
//Monthly Precrentage Rate
double minPayment = 0;
//Minimum Payment
double fMI = 0;
//First Months Interest Payment
double mIP = 0;
//Monthly Interest Payment
double totalInterest = 0; //Total Interest Amount
int monthCount = 0;
}
}
cout << "Your loan will take approximately " << monthCount << " months to pay off." << endl;
cout << "Your total interest paid is: $" << totalInterest << endl;
return 0;
}