Castle Viera Simple Interest With Program
Castle Viera Simple Interest With Program
This document presents the simple interest calculations for mortgage loans associated with
the Castle-Viera Housing Project. It outlines the lending terms for 'Gold' customers and
provides flexibility for 'Customized' customers.
Trace Table
Step No. Variable Input Value Calculation/ Output Remarks
Processing Value
1 SP 1200000 Set Selling 1200000 Initialized
Price
2 DP 100000 Set Down 100000 Initialized
Payment
3 P SP - DP 1200000 - 1100000 Principal
100000 Calculated
4 Rate 2.7 Set Interest 2.7 Initialized
Rate
5 Time 20 Set Loan 20 Initialized
Term
6 SI (P * Rate * (1100000 * 594000 Simple
Time) / 100 2.7 * 20) / Interest
100 Computed
7 Repay P + SI 1100000 + 1694000 Total
594000 Amount to
Repay
8 Month Repay / 1694000 / 7058.33 Monthly
(Time * 12) (20 * 12) Installment
Computed
Trace Table - Castle Viera Housing Project
LI CS MODE SP DP R T P SI ATR
L
KINGS GOLD VIERA $1,300 ?? ?? ?? ?? ?? ??
LEY ,000
INTL
G
COLU GOLD EDDIS $1,500 $180,0 2.65 25 ?? ?? ??
MBUS ON ,000 00
PROV
G
SILVE GOLD IVY ?? ?? ?? ?? ?? ?? ??
RSMIT
H FIN
KINGS GOLD LINCO $1,700 $260,0 2.5 20 ?? ?? ??
LEY LN ,000 00
INTL
G
COLU GOLD TESLA $2,500 $500,0 2.55 20 ?? ?? ??
MBUS DELU ,000 00
PROV XE
G
COLU CUST TESLA $2,800 - -2.66 -20 ?? ?? ??
MBUS OMISE DELU ,000 1,500,
PROV D XE 000
C
COLU CUST TESLA $2,800 $1,500 2.66 20 ?? ?? ??
MBUS OMISE DELU ,000 ,000
PROV D XE
C
Below is the Pascal program for calculating simple interest on mortgage loans for the Castle
Viera Housing Project. The program differentiates between 'Gold' customers who follow
standard lending terms and 'Customized' customers who can adjust their loan terms within
specific constraints.
PROGRAM Castle_Viera_Simple_Interest(INPUT,OUTPUT);
USES CRT;
{AUTHOR: JOHN DOE
DATE: 27TH AUGUST 2021
DESCRIPTION: THIS PROGRAM PERFORMS SIMPLE INTEREST CALCULATIONS FOR
MORTGAGE LOANS. ALL GOLD
CUSTOMERS ARE SUBJECT TO THE SAME LENDING CONDITIONS, WHEREAS CUSTOMISED
CUSTOMERS ARE ALLOWED
SOME FLEXIBILITY WITH ADJUSTED RATES AND TIMES. THE PROGRAM ACCEPTS THE
NAME OF THE LENDING
INSTITUTION, CUSTOMER STATUS, HOUSING UNIT MODEL AND BASED ON THE SELLING
PRICE, DOWNPAYMENT,
RATE AND TIME IT CALCULATES THE SIMPLE INTEREST, REPAYMENT AMOUNT AND
MONTHLY INSTALLMENT.
}
VAR
LEND,STATUS,HUNIT:STRING;
SP,P,DP,RATE,TIME:REAL;
SI,MONTH,REPAY:REAL;
BEGIN
{INITIALIZE VARIABLES}
SP:=0;P:=0;DP:=0;RATE:=0;TIME:=0;
SI:=0;MONTH:=0;REPAY:=0;
CLRSCR;
{DATA INPUT}
TEXTCOLOR(RED);
WRITELN('***********************************************************');
WRITELN(' CASTLE VIERA SIMPLE INTEREST CALCULATOR');
WRITELN('***********************************************************');
TEXTCOLOR(GREEN);
WRITELN('Please enter the name of the lending institution (Type STOP to EXIT)');
READLN(LEND);
WHILE (LEND<>'STOP') DO
BEGIN
WRITELN('Please enter your customer status: (GOLD or CUSTOMISED)');
READLN(STATUS);
{CALCULATIONS/PROCESSING}
SI:=(P*RATE*TIME)/100;
REPAY:=P+SI;
MONTH:=(REPAY/(TIME*12));
{OUTPUT}
TEXTCOLOR(BLUE);
WRITELN('***********************************************************************');
WRITELN('Lending Institution : ',LEND);
WRITELN('Housing Unit Model : ',HUNIT);
WRITELN('Selling Price : $',SP:2:2);
WRITELN('Down Payment : $',DP:2:2);
WRITELN('Principal : $',P:2:2);
WRITELN('Rate : ',rate:2:2,'%');
WRITELN('Time : ',time:2:2,' YEARS');
WRITELN('Simple Interest : $',SI:2:2);
WRITELN('Amount to Repay : $',REPAY:2:2);
WRITELN('Monthly Installment : $',MONTH:2:2);
WRITELN('***********************************************************************');
TEXTCOLOR(GREEN);
WRITELN('Please enter the name of the lending institution (Type STOP to EXIT)');
READLN(LEND);
END;