Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include <iostream> #include<cmath> #include <iomanip> using namespace std; int

ID: 3632609 • Letter: #

Question

#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;
}

Explanation / Answer

Dear, Haven't specified complete information whether to write pseudocode or execute code displays SampleRun: Enter Loan amount: 10000
Enter number of years: 2
Interest rate monthlypayment Total Payment
5.000% 438.71 10529.13
5.125% 439.27 10542.57
5.250% 439.83 10556.02
5.375% 440.40 10569.49
5.500% 440.96 10582.96
5.625% 441.52 10596.44
5.750% 442.08 10609.93
5.875% 442.64 10623.43
6.000% 443.21 10636.95
6.125% 443.77 10650.47
6.250% 444.33 10664.00
6.375% 444.90 10677.55
6.500% 445.46 10691.10
6.625% 446.03 10704.66
6.750% 446.59 10718.24
6.875% 447.16 10731.82
7.000% 447.73 10745.42
7.125% 448.29 10759.02
7.250% 448.86 10772.64
7.375% 449.43 10786.27
7.500% 450.00 10799.90
7.625% 450.56 10813.55
7.750% 451.13 10827.21
7.875% 451.70 10840.87
8.000% 452.27 10854.55
Press any key to continue . . . Psuedocode: Start
num double loan,month,total,rate,monthpay
num years;
Output "Enter Loan amount: ";
Inputloan;
output"Enter number of years: ";
Inputyears;
total=0;
rate=5;
output"Interest rate monthlypayment Total Payment ";
while rate<=8 repeat
month=rate/12./100.;
monthpay=loan*month/(1-(pow(1/(1+month),years*12)));
total=monthpay*years*12;
output" ",rate"% ",monthpay" ",total
rate+=.125; //increment rate
end While
endMain
Hope this will help you
Start
num double loan,month,total,rate,monthpay
num years;
Output "Enter Loan amount: ";
Inputloan;
output"Enter number of years: ";
Inputyears;
total=0;
rate=5;
output"Interest rate monthlypayment Total Payment ";
while rate<=8 repeat
month=rate/12./100.;
monthpay=loan*month/(1-(pow(1/(1+month),years*12)));
total=monthpay*years*12;
output" ",rate"% ",monthpay" ",total
rate+=.125; //increment rate
end While
endMain
Hope this will help you