START
START
START
display the monthly payment amount, total interest paid at the end of the loan, and
total repayment amount.
Te investm Intere Yea Monthly Total Total
st ent st rs Payment Interest Repaymen
Ca Rate t
se
int main() {
double loanAmount = 5000000; // Assume Mr. Green
invests $5,000,000
double annualInterestRateA = 0.0725;
double annualInterestRateB = 0.0675;
double annualInterestRateC = 0.0645;
int loanTermA = 3;
int loanTermB = 4;
int loanTermC = 5;
double monthlyPaymentA =
calculateMonthlyPayment(loanAmount,
annualInterestRateA, loanTermA);
double totalPaymentA = monthlyPaymentA *
loanTermA * 12;
double totalInterestA = totalPaymentA -
loanAmount;
printf("Bank A:\n");
printf("Monthly payment: $%.2lf\n",
monthlyPaymentA);
printf("Total interest paid: $%.2lf\n", totalInterestA);
printf("Total repayment amount: $%.2lf\n\n",
totalPaymentA);
return 0;
}