You are on page 1of 5

START

Read: the loan amount, interest rate, number of


years to repay;

Annual interest rate= interest rate *12


Monthly interest rate = Annual interest rate / 12/100;
Total number of payments = Number of years * 12;
monthly_payment = (principal * monthly_interest_rate) / (1
- (1 + monthly_interest_rate)^-total_payments)
Total repayment amount = Monthly payment * Total
number of payments;
Total interest paid = Total repayment amount - Loan
amount;
Output:Monthly payment amount, Total interest paid at the
end of the loan, Total repayment amount;
END

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

1 $5,000,0 7.25% 3 $156,040 $616,671.8 $5,616,671


00 .84 7 .87

2 $5,000,0 6.75% 4 $121,016 $840,781.8 $5,840,781


00 .31 4 .84

3 $5,000,0 6.45% 5 $99,086. $1,945,168 $6,945,168


00 14 .56 .56

4 $3,000,0 6.75% 4 $72,609. $504,469.1 $3,504,469


00 79 0 .10

5 $7,500,0 7.25% 3 $234,101 $924,503.8 $8,424,503


00 .26 0 .80
Certainly! Let’s calculate the monthly payments, total
interest, and total repayment amount for Mr. Green’s
options with the given interest rates and repayment
periods.
Here’s the breakdown for each bank:
1. Bank A (7.25% over 3 years):
○ Loan amount: Assume Mr. Green invests
twice the amount he made for the year, which
we’ll denote as X.
○ If X is less than $5,000,000, we’ll use
$5,000,000 as the loan amount.
○ Interest rate: 7.25% (annual rate)
○ Loan term: 3 years
○ Calculate the monthly payment using the loan
interest formula.
○ Compute the total interest paid and total
repayment amount.
2. Bank B (6.75% over 4 years):
○ Same loan amount as above.
○ Interest rate: 6.75% (annual rate)
○ Loan term: 4 years
○ Calculate the monthly payment, total interest,
and total repayment amount.
3. Bank C (6.45% over 5 years):
○ Same loan amount as above.
○ Interest rate: 6.45% (annual rate)
#include <stdio.h>
#include <math.h>
double calculateMonthlyPayment(double loanAmount,
double annualInterestRate, int loanTerm) {
double monthlyRate = annualInterestRate / 12;
int numPayments = loanTerm * 12;
return (monthlyRate * loanAmount) / (1 - pow(1 +
monthlyRate, -numofPayments));
}

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;
}

You might also like