/************************************************************************* *Jason Calcagno *Getting out of Hock *Input: priciple: amount borrowes (in dollars) annualRate: annual interest rate (as a percent of 1.0) numYears: length of the loan (in years) *Output: complete loan schedule *AP/IB computer science *November 8, 2002 *************************************************************************/ #include #include #include #include // Function prototypes double monthlyPayment ( double principal, double annualRate, int numYears ); void loanSchedule ( double principal, double annualRate, int numYears ); int main () { double principal, // Amount borrowed (in dollars) interestRate; // Annual interest rate (as a % of 1.0) int numYears; // Length of the loan (in years) cout << endl << "Enter the amount borrowed: "; cin >> principal; cout << "Enter the annual interest rate (as a % of 1.0): "; cin >> interestRate; cout << "Enter the length of the loan (in years): "; cin >> numYears; cout << "Monthly payment : " << monthlyPayment(principal,interestRate,numYears) << endl; // Output the loan schedule. loanSchedule(principal,interestRate,numYears); return 0; } double monthlyPayment ( double principal, double annualRate, int numYears ) { double mp, mpr; int numMonths; cout.setf(ios::fixed, ios::floatfield); cout<