Professional Documents
Culture Documents
Problem Statement: This program accepts the profit for the year, loan amount, interest rate, and
the number of years and calculates the monthly payments, interest and total repayment.
VARIABLE DEFINITIONS
Count Count specifies how many times a loop can be
executed. It can be used in the FOR....DO loop,
which is an automated loop with automated
increments.
Profit The amount of money Mr. Green earned from
the business during one year
Loan_Amt The amount of money to be borrowed from a
potential bank.
Bank_Name The name of the prospective bank where the
loan will be obtained
Interest_Rate The percentage at which the interest is
calculated on a loan
NoOfYears the number of years Mr. Green will take to
repay the loan to the prospective bank in
monthly installments
Monthly_Payment The monthly payment made to the bank to
cover the loan's entire repayment amount.
Interest The profit made by a bank on the repayment of
a loan. Is expressed as a percentage of the loan
amount.
Total_Repayment The total amount to be repaid, including the
interest on the loan.
Pseudocode_BankLoanforMr.Green
Variables
Count: integer
Profit, Loan_Amt, Interest_Rate, NoOfYears, Monthly_Payment, Interest,
Total_Repayment: real
Bank_Name: string
Begin
Count=1
Prompt the user for the Profit for the year
Read Profit
IF(Profit *2) > 12,000 THEN
Loan_Amt= Profit *2
ELSE
Loan_Amt= 12,000
ENDIF
FOR Count= 1 TO 3 DO
Prompt the user for the bank name, Bank_Name
Prompt the user for the interest rate, Interest_Rate
Prompt the user the number of years to repay loan, NoOfYears
Interest= (Loan_Amt* Interest_Rate* NoOfYears)/100
Monthly_Payment= (Loan_Amt+ Interest)/(NoOfYears*12)
Total_Repayment= (Loan_Amt+ Interest)
Write Bank_Name
Write Interest
Write Monthly_Payment
Write Total_Repayment
END FOR
End.
TEST DATA 1
TRACE TABLE 1
TRACE TABLE 2
TRACE TABLE 3
TRACE TABLE 4
TRACE TABLE 5
Program Bank_Operations (input,output); { this program accepts the profit, loan amount,
interest rate and the number of years to repay the loan and calculates the interest, monthly
payment and total repayment}
Var
Count: integer;
Bank_Name: string;
Count:= 1;
readln(profit);
Loan_Amt:= (profit * 2)
ELSE
Loan_Amt:= 12000;
FOR Count:= 1 to 3 DO begin { this loop executes each bank 3 times. Begin is the start of the
FOR...DO loop}
readln(Bank_Name);
readln(Interest_Rate);
readln(NoOfYears);
writeln;
We recommend that Mr. Green choose the option of “ Royal Bank” since it has the least Total
Repayment, therefore being the cheapest.