Answered step by step
Verified Expert Solution
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 #
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 fiveyear period and run the program for each of the following sets of data.
Factors of Ownership
tabletableInitial HouseCostAnnual Fuel Cost,Tax Rate
To calculate the house cost, add the initial cost to the fuel cost for five years, then add the taxes for five 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 calculateHousingCostsdouble initialCost, double annualFuelCost, float taxRate;
Sample output:
Enter home cost USD :
Enter the tax rate:
Enter annual fuel cost USD :
Your initial cost of ownership is $
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