You have bought a car, taking out a loan with annual interest rate of 9%. You wi
ID: 3646819 • Letter: Y
Question
You have bought a car, taking out a loan with annual interest rate of 9%. You will make 36 monthly payments of $165.25 each. You want to keep track of the remaining balance you owe after each monthly payment. The formula for the remaining balance is:Bal(k) =pmt[1-(1+ i)^(k-n)]/ i
Where Bal(k) =balance remaining after kth payment.
k =payment number (1, 2, 3....)
pmt =amount of monthly payment
i =interest rate per month annual rate / 12)
n =Total number of payments to be made.
Write a C++ program to print the following:
a.
Monthly Payment, monthly interest rate, and total number of payments, each on a separate line. You must include text messages for each output. Print all output to two decimal places, and $ sign where appropriate.
b.
To calculate and print the balance remaining after the first, second, and third monthly car payments, each on a separate line. You must include text messages for each output. Print all output to two decimal places, and $ sign where appropriate.
Please note that the program will display 36 lines of output as follows in a row and column format. At the end of 36 months, remaining balance should be zero.
Month# MonthlPayment TotalPaid Remaining Balance
1
2
.
.
.
34
35
36
Explanation / Answer
please rate - thanks
if any problem message me before rating-thanks
#include <iomanip>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{int i,n=36;
double pmt = 165.25,interest=0.09,bal,paid=0;
cout<<"Monthly Payment: $" <<setprecision(2)<<fixed<<pmt<<endl;
cout<<"Monthly Interest Rate: "<<interest*100./12.<<"%"<<endl;
cout<<"Total Number of Payments: "<<n<<endl;
cout<<"Month# MonthlPayment TotalPaid Remaining Balance ";
interest=interest/12. ;
for(i=1;i<=n;i++)
{bal=pmt*(1-pow((1.+interest),(i-n)))/ interest;
paid+=pmt;
cout<<i<<" "<<setprecision(2)<<fixed<<pmt<<" "<<
paid<<" "<<bal<<endl;
}
system("pause");
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.