you should have at least one loop and you need to only display so many results b
ID: 3632461 • Letter: Y
Question
you should have at least one loop and you need to only display so many results before sticking in a pause: submit pseudocode and flowchart plus cppfinancial application: comparing loan with various interest rate write a program that let the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8% with an increment of 1/8 here is a sample run:
loan Amount: 10000 enter
Number of Years: 5 enter
Interest rate Monthly payment Total Payment
5% 188.71 11322.74
5.125% 189.28 11357.13
5.26% 189.85 11391.59
........
7.85% 202.16 12129.97
8.0% 202.76 12165.83
Explanation / Answer
please rate - thanks
#include <iostream>
#include<cmath>
#include <iomanip>
using namespace std;
int main()
{double loan,month,total,rate,monthpay;
int years;
cout<<"Enter Loan amount: ";
cin>>loan;
cout<<"Enter number of years: ";
cin>>years;
total=0;
rate=5;
cout<<"Interest rate monthlypayment Total Payment ";
while(rate<=8) //do until rate > need
{ month=rate/12./100.;
monthpay=loan*month/(1-(pow(1/(1+month),years*12)));
total=monthpay*years*12;
cout<<fixed<<setprecision(3)<<" "<<rate<<"% "<<fixed<<setprecision(2)
<<monthpay<<" "<<total<<endl;
rate+=.125; //increment rate
}
system("pause");
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.