### How do make a program to find the annual after-tax? This is what I have to do and this is what I have so far, but it just finds the interest. How do I find the annual after-tax?

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% of the initial loan balance credited toward paying off the loan principal plus 6% of the initial loan balance in interest. The initial loan balance is the price minus the down payment. Assume a 35% marginal tax rate and assume that interest payments are tax deductible. So, the tax savings is 35% of the interest payment. Your program should use at least two function definitions. Your program should allow the
user to repeat this calculation as often as the user wishes.

Thanks
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748`` ``````#include using namespace std; double interest_cal(double rate, double months, double balance); int main() { double rate, months, interest, balance; cout << "Please enter the initial balance(Press 0 to end program)\n"; cin >> balance; while (balance != 0) { cout << "Please enter the rate\n"; cin >> rate; cout << "Please enter the number of months\n"; cin >> months; rate = rate * 0.01/12; interest = interest_cal(rate, months, balance); cout << "Your interest owed is " << interest << " \n"; cout << "Please enter the initial balance(Press 0 to end program)\n"; cin >> balance; } system("pause"); return 0; } double interest_cal(double rate, double months, double balance) { double interest, total_int = 0; for (int count = 1; count <= months; count++) { interest = rate * balance; balance = balance + interest; total_int += interest; } return total_int; } ``````
Last edited on So whats your problem? Write a new function to do the simple math.
Topic archived. No new replies allowed.