Checkpoints 1) Include name, e-mail, and lab# as comments in the code and also include code to output this information to the output. 2) Minimum of three (3) comments (including Pre/Post) in each function. Note that if the parameter is a reference to (i.e. address of) a value, then the Pre comment must so state. 3) User defined constants for property tax rate, cost of utilities, and cost of insurance. Use non-global memory constant for percent of down payment. 4) Use exactly one function separate from main for input. 5) Call a calculation function from main which handles all calculations. This function needs to call a sub-function (another function) to calculate exactly the following and no more: amount of down payment, amount of the loan, amount of monthly mortgage payment. 6) Use exactly one function called from main for output.  7) Output must be formatted exactly as shown on lab write-up with decimal points lined up. Output must be copied to a separate file. 8) All functions (other than main() & your signature function) must use prototype style. 9) Use reference variables when necessary and ONLY WHEN NECESSARY. Test data   (see bankrate.com or use Excel & pmt()to check your answers)         Set 1 – $600,000, 5%, 20 Set 2 – $400,000, 4.2%, 30

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
  • Checkpoints

1) Include name, e-mail, and lab# as comments in the code and also include code to output this information to the output.

2) Minimum of three (3) comments (including Pre/Post) in each function. Note that if the parameter is a reference to (i.e. address of) a value, then the Pre comment must so state.

3) User defined constants for property tax rate, cost of utilities, and cost of insurance. Use non-global memory constant for percent of down payment.

4) Use exactly one function separate from main for input.

5) Call a calculation function from main which handles all calculations. This function needs to call a sub-function (another function) to calculate exactly the following and no more: amount of down payment, amount of the loan, amount of monthly mortgage payment.

6) Use exactly one function called from main for output. 

7) Output must be formatted exactly as shown on lab write-up with decimal points lined up. Output must be copied to a separate file.

8) All functions (other than main() & your signature function) must use prototype style.

9) Use reference variables when necessary and ONLY WHEN NECESSARY.

  • Test data   (see bankrate.com or use Excel & pmt()to check your answers)        

Set 1 – $600,000, 5%, 20

Set 2 – $400,000, 4.2%, 30

OUTPUT
All values input and used in the calculations as well as the monthly payment and total
monthly house cost need to be output as follows:
MONTHLY COST OF HOUSE
SELLING PRICE
$XXXXXX.XX
DOWN PΑΥΜENT
XXXXXX.XХ
AMOUNT OF LOAN
XXXXXX.XX
INTEREST RATE
XX.X%
ΤAX RΑΤΕ
XX.X%
DURATION OF LOAN (YEARS)
XX
ΜΟΝΤΗLY PPAYΜΕΝΤ
MORTGAGE
XXXX.ХX
UTILITIES
XXXX.XX
PROPERTY TAXES
XXXX.XX
INSURANCE
ХXXX.XX
$ XXXXX.XX
Transcribed Image Text:OUTPUT All values input and used in the calculations as well as the monthly payment and total monthly house cost need to be output as follows: MONTHLY COST OF HOUSE SELLING PRICE $XXXXXX.XX DOWN PΑΥΜENT XXXXXX.XХ AMOUNT OF LOAN XXXXXX.XX INTEREST RATE XX.X% ΤAX RΑΤΕ XX.X% DURATION OF LOAN (YEARS) XX ΜΟΝΤΗLY PPAYΜΕΝΤ MORTGAGE XXXX.ХX UTILITIES XXXX.XX PROPERTY TAXES XXXX.XX INSURANCE ХXXX.XX $ XXXXX.XX
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 =
a*i(1+i)ª
(1 + i)ª – 1 where a=amount of loan
i=rate of interest per compounding period
(annual rate/12)
n=number of compounding periods (yrs*12)
Assume that the down payment will be 20% of selling price, yearly tax rate is 1.25% of
selling price, utilities will be approximately $300.00 per month, and insurance will be
$550.00 per year.
DATA
Use preprocessor statements to set the tax rate, cost of insurance, and the cost of utilities.
Set the percentage of down payment as a non-global memory constant. Prompt the user
for the selling price, the rate of interest, and the number of years for the loan.
CALCULATIONS
Use at least four functions in addition to main: a function to input all data, a function
which handles all computations including invoking a subfunction to compute the down
payment, amount of loan, and mortgage payment, and, finally, one to output the results.
Transcribed Image Text: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 = a*i(1+i)ª (1 + i)ª – 1 where a=amount of loan i=rate of interest per compounding period (annual rate/12) n=number of compounding periods (yrs*12) Assume that the down payment will be 20% of selling price, yearly tax rate is 1.25% of selling price, utilities will be approximately $300.00 per month, and insurance will be $550.00 per year. DATA Use preprocessor statements to set the tax rate, cost of insurance, and the cost of utilities. Set the percentage of down payment as a non-global memory constant. Prompt the user for the selling price, the rate of interest, and the number of years for the loan. CALCULATIONS Use at least four functions in addition to main: a function to input all data, a function which handles all computations including invoking a subfunction to compute the down payment, amount of loan, and mortgage payment, and, finally, one to output the results.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education