0% found this document useful (0 votes)
0 views6 pages

Castle Viera Simple Interest With Program

The document outlines simple interest calculations for mortgage loans in the Castle-Viera Housing Project, detailing lending terms for 'Gold' and 'Customized' customers. It includes specific housing models, selling prices, down payments, interest rates, and loan durations. Additionally, it provides a Pascal program for calculating simple interest, repayment amounts, and monthly installments based on user inputs.

Uploaded by

Mani Coops
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views6 pages

Castle Viera Simple Interest With Program

The document outlines simple interest calculations for mortgage loans in the Castle-Viera Housing Project, detailing lending terms for 'Gold' and 'Customized' customers. It includes specific housing models, selling prices, down payments, interest rates, and loan durations. Additionally, it provides a Pascal program for calculating simple interest, repayment amounts, and monthly installments based on user inputs.

Uploaded by

Mani Coops
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Castle Viera Simple Interest Calculation

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.

Gold Customers - Housing Models and Lending Terms


No. Model Selling Price Down Rate (%) Time (Years)
Payment
1 VIERA 1,200,000 100,000 2.7 20
2 EDDISON 1,500,000 180,000 2.65 25
3 LINCOLN 1,700,000 260,000 2.5 20
4 IVY 2,000,000 250,000 2.47 19
5 TESLA 2,500,000 500,000 2.55 20

Customized Customers - Flexible Terms


No. Adjusted Adjusted Down Adjusted Rate Adjusted Time
Selling Price Payment (%) (Years)
1 1,000,000 - 50,000 - 2.0 - 3.0 10 - 30
3,000,000 500,000

Algorithm and Code Implementation


[Insert extracted text here manually]

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

Key: Meaning of Terms


LI - Lending Institution
CS - Customer Status
MODEL - Housing Unit Model
SP - Selling Price
DP - Down Payment
R - Rate
T - Time
P - Principal
SI - Simple Interest
ATR - Amount to Repay

Error Testing Cases


ERROR - Invalid Lender: Testing for valid lending institutions
ERROR - Invalid Customer Status: Testing for valid customer status (Gold customer)
ERROR - Invalid Model: Testing for valid housing model
ERROR - Invalid Price: Test for negative price of a customized customer
ERROR - Invalid Downpayment: Test for negative downpayment of a customized customer
ERROR - Invalid Rate: Test for negative rate of a customized customer
ERROR - Invalid Time: Test for negative time of a customized customer

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

WHILE (STATUS<>'GOLD') AND (STATUS<>'CUSTOMISED') DO BEGIN


WRITELN('Please re-enter your customer status: (GOLD or CUSTOMISED ONLY)');
READLN(STATUS);
END;

WRITELN('Please enter the housing unit model:(VIERA,EDDISON,LINCOLN,IVY or


TESLA)');
READLN(HUNIT);

WHILE (HUNIT<>'VIERA') AND (HUNIT<>'EDDISON') AND (HUNIT<>'LINCOLN') AND


(HUNIT<>'IVY') AND (HUNIT<>'TESLA') DO BEGIN
WRITELN('Please re-enter the housing unit model:(VIERA,EDDISON,LINCOLN,IVY or
TESLA)');
READLN(HUNIT);
END;

{GOLD STATUS CUSTOMERS}


IF (STATUS='GOLD') THEN
BEGIN
CASE HUNIT of
'VIERA': BEGIN SP:=1200000; DP:=100000; P:=SP-DP; RATE:=2.7; TIME:=20; END;
'EDDISON': BEGIN SP:=1500000; DP:=180000; P:=SP-DP; RATE:=2.65; TIME:=25;
END;
'LINCOLN': BEGIN SP:=1700000; DP:=260000; P:=SP-DP; RATE:=2.5; TIME:=20;
END;
'IVY': BEGIN SP:=2000000; DP:=250000; P:=SP-DP; RATE:=2.47; TIME:=19; END;
'TESLA': BEGIN SP:=2500000; DP:=500000; P:=SP-DP; RATE:=2.55; TIME:=20;
END;
END;
END;

{CUSTOMISED STATUS CUSTOMERS}


IF (STATUS='CUSTOMISED') THEN
BEGIN
WRITELN('Please enter the adjusted selling price (1000000 TO 3000000)');
READLN(SP);
WHILE (SP<1000000) OR (SP>3000000) DO BEGIN
WRITELN('Please re-enter, the adjusted selling price must be between 1000000
and 3000000');
READLN(SP);
END;

WRITELN('Please enter the adjusted down payment (50000 TO 5000000)');


READLN(DP);
WHILE (DP<50000) OR (DP>5000000) DO BEGIN
WRITELN('Please re-enter, the adjusted down payment must be between 50000
and 5000000');
READLN(DP);
END;

WRITELN('Please enter the adjusted rate (2 TO 3)');


READLN(RATE);
WHILE (RATE<2) OR (RATE>3) DO BEGIN
WRITELN('Please re-enter, the adjusted rate must be between 2 and 3');
READLN(RATE);
END;

WRITELN('Please enter the adjusted time for repayment (10 TO 30)');


READLN(TIME);
WHILE (TIME<10) OR (TIME>30) DO BEGIN
WRITELN('Please re-enter, the adjusted time must be between 10 and 30 years');
READLN(TIME);
END;
P:=SP-DP;
END;

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

WRITELN('THANK YOU FOR USING OUR SIMPLE INTEREST CALCULATOR------GOOD BYE


!');
END.

You might also like