Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calculates the annual after-tax cost of a new house for the first year of ownership. The user inputs the price of

image text in transcribedWrite a program that calculates the annual after-tax cost of a new house for the first year of ownership. The user inputs the price of the house and the downpayment made on it. The program thus knows what the loan amount is: the difference between the house price and the downpayment. The program also knows at least three constants: the loan interest rate (6%), the loan reduction cost rate (3%), and your tax rate (35%). Home loans are subjected to an interest rate - that is one cost to home-owners. Additionally, they are paying off their loan at a certain rate - that is another cost. Thus the total annual mortgage costs for home-ownership is defined. However, home-owners get a bit of a break on their total costs because they can deduct part of their interest payments when they pay their taxes. These tax savings amount to the interest payment amount multiplied by the tax rate. So, the real annual cost to a home-owner - the annual after-tax cost - is computed as the total annual mortgage cost minus the tax savings. As mentioned, the input should be the price of the house and the down payment. Inputs should be of type double. Your program should use at least two function definitions (other than main function) and should allow the user to repeat this calculation as often as the user wishes. A program which does not use at least 2 functions will be awarded a score of zero, even if all tests pass. The presence of these functions will be checked by the instructor and the TAs. You are only permitted to use the iostream library. Additionally, the program must make good use of comments in the code, per the discussions we have been having in class. Again, the presence of comments (and thier good use) will be checked by the instructor and the TAs. A session should look exactly like the following example (including whitespace and formatting - note that there is no whitespace at the end of each of these lines and each printed line has a newline at the end), with all manners of different numbers for inputs and the output:

Write a program that calculates the annual after-tax cost of a new house for the first year of ownership. The user inputs the price of the house and the downpayment made on it. The program thus knows what the loan amount is: the difference between the house price and the downpayment. The program also knows at least three constants: the loan interest rate (6%), the loan reduction cost rate (3%), and your tax rate (35%) Home loans are subjected to an interest rate that is one cost to home-owners. Additionally, they are paying off their loan at a certain rate that is another cost. Thus the total annual mortgage costs for home-ownership is defined. However, home-owners get a bit of a break on their total costs because they can deduct part of their interest payments when they pay their taxes. These tax savings amount to the interest payment amount multiplied by the tax rate So, the real annual cost to a home-owner the annual after-tax cost is computed as the total annual mortgage cost minus the tax savings As mentioned, the input should be the price of the house and the down payment. Inputs should be of type double. Your program should use at least two function definitions (other than main function) and should allow the user to repeat this calculation as often as the user wishes. A program which does not use at least 2 functions will be awarded a score of zero, even if all tests pass. The presence of these functions will be checked by the instructor and the TAs You are only permitted to use the iostream library. Additionally, the program must make good use of comments in the code, per the discussions we have been having in class. Again, the presence of comments (and thier good use) will be checked by the instructor and the TAs A session should look exactly like the following example (including whitespace and formatting note that there is no whitespace at the end of each of these lines and each printed line has a newline at the end), with all manners of different numbers for inputs and the output Enter the home price (or zero to quit) t 800000 nter the down payment 80000 The after-tax cost is $49680.00 annually Enter the home price (or zero to quit) 120000 Enter the down payment 10500 The after-tax cost is $7555.50 annually Enter the home price (or zero to quit) 550000 Enter the down payment. The after -tax cost is $37950.00 annually Enter the home price (or zero to quit 750000 Enter the down payment 750000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Autonomous Database Easy And Understandable Guide For Beginners

Authors: IP Specialist

1st Edition

B0BZFD1CFV, 979-8389040021

More Books

Students also viewed these Databases questions

Question

5. This question is about disjoint set. (20%) G H M T S Z W

Answered: 1 week ago