Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that computes the annual after-tax cost of a new house for the f

ID: 3564427 • Letter: W

Question

Write a program that computes the annual after-tax cost of a new house for the first year of ownership. The cost is computed as the annual mortgage cost minus the tax savings. The input should be the price of the house and the down payment. The annual mortgage cost can be estimated as 3 percent of the initial loan balance credited toward paying off the loan principal plus 6 percent of the initial loan balance in interest. The initial loan balance is the price minus the down payment. Assume 35 percent marginal tax rate and assume that interest payments are tax deductible. So, the tax savings is 35 percent of the interest payment. Your program should use at least two different functions and should allow the user to repeat this calculation as often as the user wishes. If mortgage price or down payment are negative, display an error message that asks the user if they wish to enter more data.

Explanation / Answer

#include <iostream>

using namespace std;

double annual_mortgage_cost(double initial_balance);

double tax_savings(double initial_balance);

double initial_loan_balance(double house_price, double down_payment);

int main()

{

  

double house_price, down_payment, initial_balance;

char ans;

cout.setf(ios::fixed);

cout.setf(ios::showpoint);

cout.precision(2);

do

{

cout << "How much did your house cost? ";

cin >> house_price;

cout << "What was your down payment? ";

cin >> down_payment;

initial_balance = initial_loan_balance(house_price, down_payment);

cout << "Your annual after-tax cost of home ownership is $" <<annual_mortgage_cost(initial_balance) - tax_savings(initial_balance)<< " ";

cout << "Your initial loan balance is " <<initial_balance<< " ";

cout << "Thats $" <<annual_mortgage_cost(initial_balance)<< " annual mortgage cost ";

cout << "With a tax savings each year of $" <<tax_savings(initial_balance)<< " ";

  

cout << "Wanna repeat it again? (y/n) ";

cin >> ans;

}

while (ans == 'y' || ans == 'Y');

return 0;

}

double annual_mortgage_cost(double initial_loan_balance)

{

double cost;

cost = initial_loan_balance * (.09); //3% credited toward paying off the loan principal and 6% interest

return cost;

}

double tax_savings (double initial_loan_balance)

{

double tax_savings;

tax_savings = initial_loan_balance * 0.021; //35% of a 6% interest payment

return tax_savings;

}

double initial_loan_balance(double house_price, double down_payment)

{

double initial_loan_balance;

initial_loan_balance = house_price - down_payment;

return initial_loan_balance;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote