Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MONTHLY HOUSE COSTS Write a C + + program to calculate the monthly cost of a house given the selling price, annual rate of interest,
MONTHLY HOUSE COSTS
Write a C program to calculate the monthly cost of a house given the selling price, annual rate of interest, and number of years for the loan. The monthly mortgage payment may be computed using the following formula:
payment aiin
in where aamount of loan
irate of interest per compounding period annual rate
nnumber of compounding periods yrs
Assume that the down payment will be of selling price, yearly tax rate is of selling price, utilities will be approximately $ per month, and insurance will be $ per year.
INPUT
In a separate function called from main prompt the user for the selling price, the rate of interest, and the number of years for the loan.
Use preprocessor defined constants to set the tax rate, cost of insurance, and the cost of utilities. Set the percentage of down payment as a nonglobal memory constant in the function the value is used in
CALCULATIONS
A function called from main calcMonthlyCosts is to handle all computations including invoking calling two other functions which I like to term as subfunctions See the structure chart below. calcLoanDownMortgage is to calculate the three values: amount down of house selling price amount of loan selling price minus amount down and the monthly mortage using the formula above. The other function called from calcCosts is to calculate the total of the monthly costs including mortgage payment, utilities, property tax per month, and insurance.
OUTPUT
One function called from main is to be used to outout values input and values used in the calculations as well as the monthly payment and total monthly house cost. Output needs to be formatted as follows:
MONTHLY COST OF HOUSE
SELLING PRICE XXXXXXXX
DOWN PAYMENT XXXXXXXX
AMOUNT OF LOAN XXXXXXXX
INTEREST RATE XXXX
TAX RATE XXXX
DURATION OF LOAN YEARS XX
MONTHLY PAYMENT
MORTGAGE XXXXXX
UTILITIES XXXXXX
PROPERTY TAXES XXXXXX
INSURANCE XXXXXX
$ XXXXXXX
STRUCTURE CHART SHOWING NECESSARY FUNCTIONS
image.png
CHECKPOINTS
Include name, email, and lab# as comments at the top of your code.
Minimum of three comments including PrePostPurpose in each function other than main and a minimum of comments in main function.
Reference parameters must be described as such. For example: void fundouble& length, Pre: reference to length,
Use globally defined constants for property tax rate, cost of utilities, and cost of insurance. Use nonglobal memory constant for percent of down payment.
Use exactly one function which must be called from main for all input.
Use C Style with prototype before main and the function definition after main
Write a calculation function shown as calcMonthlyCosts in structure chart which must be called from main which handles all calculations. This function needs to contain a call to exactly two other functions. The first of these shown as calcDownLoanMortgage in structure chart is to calculate precisely three values: the down payment, amount of the loan and monthly mortgage payment. The second shown as calcTotal in structure chart is to calculate the total cost per month of owning this house.
Use C Style with prototype before main and the function definition after main
Write a function to be called from calcMonthlyCosts function shown as calcDownLoanMortgage in structure chart which calculates precisely three values: the down payment, amount of the loan and monthly mortgage payment.
Use C Style with prototype before main and the function definition after main
Write a function to be called from calcMonthlyCosts function shown as calcTotal in structure chart which calculates the total cost per month of owning this house.
Use C Style with prototype before main and the function definition after main
Use exactly one function which is called from main for output.
Use C Style with prototype before main and the function definition after main Output must be formatted exactly as shown on lab writeup with decimal points lined up
Include code to output to the screen your name AND something JUST ONE thing you learned from completing this lab. Be brief.
Use pass by reference where needed and only where needed.
TEST DATA see mortgagecalculator.org or use Excel & pmtto check your answers
Set $
Set $
To check your output you might find mortgage calculatorLinks to an external site. helpful.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started