Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program # 2 Housing Costs In shopping for a new house, you must consider several factors. In this problem the initial cost of the house,

Program #2
Housing Costs
In shopping for a new house, you must consider several factors. In this problem the initial cost of the house, the estimated annual fuel costs, and the annual tax rate are available. Write a program that will determine the total cost of a house after a five-year period and run the program for each of the following sets of data.
Factors of Ownership
\table[[\table[[Initial House],[Cost]],Annual Fuel Cost,Tax Rate (%)],[67,000,2,300,2.5],[62,000,2,500,2.5],[75,000,1,850,2.0]]
To calculate the house cost, add the initial cost to the fuel cost for five (5) years, then add the taxes for five (5) years. Taxes for one year are computed by multiplying the tax rate by the initial cost. Write and call a function that calculates the cost of ownership, and returns it to the end user after the values are input. Your function should be similar to:
double calculateHousingCosts(double initialCost, double annualFuelCost, float taxRate);
Sample output:
Enter home cost (USD) :450000
Enter the tax rate((%):2.5
Enter annual fuel cost (USD) : 1500
Your initial cost of ownership is $513750.00
image text in transcribed

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

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions