Can anyone help me in doing loan calculator program? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Can anyone help me in doing loan calculator program?

11th Apr 2022, 3:48 AM
Nilam Pari
Nilam Pari - avatar
1 Answer
0
In C++ : ````````````````````````````````````````````````````````````````````````````````````````` #include <iostream> #include <iomanip> using namespace std; int main() { // Get the loan amount. double loanAmount; cout << "Enter the loan amount: "; cin >> loanAmount; // Get the interest rate. double interestRate; cout << "Enter the interest rate: "; cin >> interestRate; // Get the number of years. #include <iostream> #include <iomanip> using namespace std; int main() { // Get the loan amount. double loanAmount; cout << "Enter the loan amount: "; cin >> loanAmount; // Get the interest rate. double interestRate; cout << "Enter the interest rate: "; cin >> interestRate; // Get the number of years. int numberOfYears; cout << "Enter the number of years: "; cin >> numberOfYears; // Calculate the monthly payment. double monthlyPayment = loanAmount * (interestRate / 12) / (1 - (1 + interestRate / 12)^(-numberOfYears)); // Print the monthly payment. cout << fixed << setprecision(2); cout << "The monthly payment is
quot; << monthlyPayment << endl; return 0; }
30th May 2023, 11:09 AM
Sameer Mistry
Sameer Mistry - avatar