Your question (max 1024 symbols)You are required to write a program that lets 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 3.50% to 8.00%, with an increment of 0.25. If you enter the loan amount 5,000 for five years, it will display a table as follows:
#include <iostream.h> #include <conio.h> #include <math.h> main(){ float L,ap,mp,tp,C;& //L - loan amount, ap - annual payment, mp - monthly payment, tp - total payment, c - interest rate int Y,N,i; //Y - loan period in years, N - loan period in months, i - counter cout<<"Enter the loan amount: "; cin>>L; cout<<"Enter the loan period: "; cin>>Y; cout<<"InterestRate"<<"& quot;<<"MonthlyPayment"<<"& quot;<<"TotalPayment\r\n"; C = 3.5; for (i=0;i<=18;i++){ & //the month payment is one-twelfth of an annual payment: & mp = ( L + ( ( L * C/100 ) * Y ) ) / ( Y * 12 ); & //Let's calculate the total payment: & tp = mp*12*Y; & //printing results: & cout<<C<<"%& quot;<<mp<<"& quot;<<tp<<"\r\n"; & //calculating next interest value: & C = C+0.25; & } getch(); }
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
do i need to fill up the space for loan period and the loan amount?? and how to print screen the answer if i used microsoft visual c++ 2010
Leave a comment