Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have just purchased a stereo system that cost $1000 on the following credit plan: no down payment, an interest rate of 18% per year

You have just purchased a stereo system that cost $1000 on the following credit plan: no down payment, an interest rate of 18% per year (and hence 1.5% per month), and monthly payments of $50. The monthly payment of $50 is used to pay the interest, and whatever is left is used to pay part of the remaining debt. Hence, the first month you pay 1.5% of $1000 in interest. That is $15 in interest. The remaining $35 is deducted from your debt, which leaves you with a debt of $965.00. The next month you pay interest of 1.5% of $965.00, which is $14.48. Hence, you can deduct $35.52 (which is $50$14.48) from the amount you owe. I have a code written but it only loops infinitely which will be shown below.

int main() { double loan,yearlyInterest,monthlyPayment,sumtin,balance,inTotal; double decinterest,principal,lastPayment; int month;

cout << "Enter the amount of loan: "; cin >> loan; cout << "Enter the yearly interest: "; cin >> yearlyInterest; cout << "Enter the monthly amount paid: "; cin>> monthlyPayment; cout<

cout <<"************************************************************" << endl; cout <<" Amortization Table" << endl; cout <<"************************************************************" << endl; cout << "Month";

cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(2);

cout << setw(10) << "Balance"; cout << setw(10) << "Payment"; cout << setw(6) << "Rate"; cout << setw(12) << "Interest"; cout << setw(12) << "Principal" <

double monthlyRate = yearlyInterest / 12; decinterest = (yearlyInterest/100)/12;

while(loan > 0) {

if(balance * decinterest + balance > 50){ sumtin = (loan*decinterest); principal = monthlyPayment - sumtin; inTotal=inTotal+sumtin; balance=loan; loan =loan-principal; } else { sumtin = balance * decinterest; inTotal = inTotal * decinterest; lastPayment = monthlyPayment - decinterest + balance; balance = 0; } cout << left << setw(8)<

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions