You are to create an output showing a Mortgage Table for mon

You are to create an output showing a Mortgage Table for monies you have borrowed. Given the amount of a mortgage, the rate of interest being charged, the monthly payment, and the amount of tax due on the property (per year), produce a table of principal, interest, tax, payment, and principal left for each month of the mortgage’s existence. First you have to calculate the monthly payment amount before producing an ‘Amortization Schedule’. See the earlier assignment (warm up programs).

Below is how to calculate interest values; determining the breakdown of each monthly payment

Even though the monthly payment is fixed, the amount of money paid to interest varies each month. The remaining amount is used to pay off the loan itself. The complicated formula above ensures that after 360 payments, the mortgage balance will be $0.

For the first payment, we already know the total amount is $1,342.05. To determine how much of that goes toward interest, we multiply the remaining balance ($250,000) by the monthly interest rate: 250,000 x 0.416% = $1,041.67. The rest goes toward the mortgage balance ($1,342.05 - $1,041.67 = $300.39). So after the first payment, the remaining amount on the mortgage is $249,699.61 ($250,000 - $300.39 = $249,699.61).

The second payment\'s breakdown is similar except the mortgage balance has decreased. So the portion of the payment going toward interest is now slightly less: $1,040.42 .... ($249,699.61 * 0.416% = $1,040.42). I would also like a column that shows the ‘taxes’ paid each month and that the monthly payment has the taxes added to the monthly mortgage payment. Tax column not shown below.


I need a c++ program to do the following. Also needs to output to a file. I am using xcode.

For your program use the following: the principal is $22,500.00, the interest is 5.37% per year, the tax per year is $350.00, and the number of payments are for 8 years.

You are to produce a table with the appropriate values (the above example plus one column). Make sure you have labels, totals and all the values line up nicely. I like the commas in the big numbers and ‘$’ signs in the front of each number. All money values are to be shown in dollars and cents.

Solution

#include<iostream>

#include <iomanip>

#include<math.h>

using namespace std;

int main ()

   {int cnt=1;

   double principal, rate, mrate, mpay, tax,interest;

   cout<<\"Enter the principal of the loan: \";

   cin>>principal;

   cout<<\"What is the tax for the year? \";

   cin>>tax;

   tax=tax/12.;

   cout<<\"What is the Annual Interest Rate? \";

   cin>>rate;

   cout<<\"What is the monthly payment? \";

   cin>>mpay;

   mrate=rate/100./12.;

   cout<<\"Month Principal($) Interest($)Tax($) Payment($) New Principal($)\ \";

   while(principal+interest>mpay)

     {

     cout<<setw(5)<<cnt<<setw(10)<<fixed<<setprecision(2)<<principal<<\"\\t\"

         <<setw(10)<<interest<<\"\\t\"<<tax<<\"\\t\"<<mpay<<\"\\t\";

     principal=principal+interest+tax-mpay;

      cout<<setw(10)<<principal<<endl;

       cnt++;

      interest=principal*mrate;

      }

   interest = principal*mrate;

   mpay=principal+interest+tax;

cout<<setw(5)<<cnt<<setw(10)<<fixed<<setprecision(2)<<principal<<\"\\t\"

         <<setw(10)<<interest<<\"\\t\"<<tax<<\"\\t\"<<mpay<<\"\\t\";

   principal=principal+interest+tax-mpay;

cout<<setw(10)<<fabs(principal)<<endl;     

system(\"pause\");

   return 0;

   }

You are to create an output showing a Mortgage Table for monies you have borrowed. Given the amount of a mortgage, the rate of interest being charged, the month
You are to create an output showing a Mortgage Table for monies you have borrowed. Given the amount of a mortgage, the rate of interest being charged, the month

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site