V22.0480.002 : Fall 1998
Applied Internet Technology
Assignment - 2 (Due Monday November 2nd)
CGI Version of Mortgage Advisor
In this assignment, you are expected to write a CGI program in Java
for the Mortgage Advisor that you wrote in Assignment 1.
The assignment will be graded for:
1. The technical content (Java)
2. Correct interpretations of fields ($1,000/- in a numeric field has
to be interpreted the same as 1000)
3. User Friendly Interface.
4. Error Checks (user could enter 'Two thousand' in the income field)
This assignment will be done in groups of two students. Try to keep the same groups as
you had for assignment 1. You cannot change groups without prior permission of the TA.
Read the policy sheet on Assignments for further details.
You should implement CGI scripts for both the POST method and the GET method.
You have to submit the following:
1. One Java Program
2. One or Two CGI scripts (that call the Java program)
3. Two HTML pages. One with the GET method and another with the POST method.
You are expected to use only vi, emacs or Notepad for writing your CGI program in Java.
The previous assignment is given below for completeness.
Write a Web program that will help a person to compute the Mortgage
payments for a house he/she is planning to buy.
This program has to have three functions:
a. Advise whether it makes sense to Rent a house or Buy a house.
b. Compute the Mortgage & other payments per month.
c. Determine if a person qualifies for a Mortgage.
The program has to walk the user through a number of different options and
collect all the information that is required. The information that has to
be gathered from the user are:
1. Complete Name
4. State of Residence (NY, NY, CT)
5. The Person's pay (per weekly, bi-weekly, monthly, yearly?)
6. Current Rent
7. The Loan Amount
8. Mortgage Rate (provide defaults like 6.5%, 7.00%, 7.5%, 8.00%)
9. Period of Loan (provide standard periods like, 10, 15, 20 & 30 years)
You have to present the user with a spaced out user friendly web interface
for navigating through different options. You should not overwhelm the user
with all the information at once. Get first four of the above data in the first
page, the rest (5 thru 9) in a second page and then display the result in a
The monthly mortage is calculated as follows: (this is not the precise way to
do the actual mortgage calculation, rather only a very rough approximation)
Principle = 'LoanAmount'
Interest = 'LoanAmount' * ( 'MortgageRate%'/100 ) * 'LoanPeriod'
Total Payment = Principle + Interest
Monthly Mortgage = 'TotalPayment' / ('LoanPeriod'*12)
Monthly Property Tax = ( 'LoanAmount' * 'TaxRate' ) / 100*12
Monthly Maintenance = ( 'LoanAmount' * '1.0%' ) / 100*12
The TaxRate is determined by the State of Residence. Assume the following:
New York = 2.5%
New Jersey = 3.0%
Connecticut = 2.75%
In addition, a person qualifies for a Mortage of 'LoanAmount' dollars if
his/her yearly income is 35% of the loan amount.
Monthly Income = $3,000/-
'LoanAmount' = $100,000/-
'MortgageRate' = 6.5%
'LoanPeriod' = 20 Years
Principle = $100,000/-
Interest = 100,000 * (6.5/100) *20 = $130,000
Total Payment = $100,000 + $130,000
Monthly Payment = $958/-
Monthly Property Tax = $250/- (for New Jersey resident)
Monthly Maintenance = $83/-
The person qualifies for the Loan amount.
Present the user with the following result:
Dear Mr or Ms (depending on the Sex field) 'Name',
Based on the information that you have provided. It makes/does not
make sense for you to buy a house at this time. The numbers below support
Monthly Rent : $1,350/-
Monthly Mortagage : $958/-
Monthly Property Taxes : $250/-
Monthly Maintanence : $83.3/-
Total Monthly House Cost = $1,291/-
You will save $60/- per month and in addition will have property worth over
$100,000/- at the end of 20 years.
Based on your income, you will qualify for a mortage for a loan of $100,000/-
Please contact our office at the below address for helping you save money.