Homework 5, An in class exercise.

Short Description:

Write a program that will compute mortgages.

This assignment is worth 10 points.

Goals

When you finish this homework, you should have:

Formal Description

For this homework you will write a program to solve a problem from Math 104. You do not need a knowledge of the mathematics as I have provided a fairly detailed algorithm to solve the problem. If you get in trouble, you can look at the code segments associated with the given step. In the end, my code is provided in case you run into difficulties.

I understand that you can just submit my code as your final result, but I feel that this is a huge mistake. Please work through the exercise.

A mortgage is a loan to purchase a home. You may take out multiple mortgages in your lifetime and if you do, one of these will most likely be the largest amount of money that you borrow.

It is common in Math 104 to solve mortgage problems. For these problems you are given

You are asked to compute In addition, some of these problems ask if the borrower qualifies for the loan. This is based on In this exercise, we will step through writing a program to compute these values.

Here is a typical problem from A Survey Of Mathematics with Applications by Angle, Abbot and Runde 10th.

Number 22 page 616 Evaluating a Lone Request:
Kathy wants to buy  a condominium selling for $95,000.  The taxes on the 
property are $1500 per year, and homeowners' insurance is $330 per year. 
Kathy's gross monthly income is $4000.  She has 15 monthly payments of 
$135 remaining on her van.  The bank is requiring 20% down and is charging
9.5% interest rate.  Her bank will approve a loan that has a total monthly 
mortgage payment of principal, interest, property taxes and homeowners' 
insurance that is less than or equal to 28% of her adjusted monthly income.
  1. Determine the required down payment. $19,000
  2. Determine 28% of her adjusted monthly income. $1,982.29
  3. Determine a monthly payment of principal and interest for a 25-year loan. $664.04
  4. Determine her total monthly payment including homeowners' insurance and taxes. $817.01
  5. Does Kathy qualify for the loan? Yes
The only formula you will need is: $$ m = \frac{p(\frac{r}{n})}{1-(1+\frac{r}{n})^{-nt}} $$ Where:

The Program

  1. Begin by starting the program. Call it hw5.cpp
  2. Basic Input and Down Payment
  3. Compute the basic loan information
  4. Compute total monthly payment
  5. Can she afford the loan
My final code is here if you need help.

Submission

Submit the assignment to the D2L folder Homework 5 by October 15.