27
C++
29 /* Change annual interest rate to monthly interest rate */
30 MonthlyIntRate = GetMonthlyIntRate(AnnualIntRate);
31 /* Calculate monthly payment */
32 MonthlyPayment =
33 CalculateMonthlyPayment(LoanAmount,LoanTermMonths,MonthlyIntRate);
34 /* Printout the table, a line each time */
35 /* j is used as a flag to control the format */
36 PrintMonthlyPayment(LoanTermYears,AnnualIntRate,MonthlyPayment,j);
37 }
38 }
39 }
40 /* Four functions are defined below */
41 /* (1) Change years to months */
42 int GetLoanTerm(int Years)
43 {
44 int Months;
45 Months = 12 * Years;
46 return(Months);
47 }
48 /* (2) Change annual interest rate to monthly interest rate */
49 double GetMonthlyIntRate(double AnnualRate)
50 {
51 double MonthlyRate;
52 ...