76 942
Assignments Done
Successfully Done
In June 2019

Answer to Question #39227 in C++ for Ahmed

Question #39227
Write a program that obtains (from the user) the amount, interest rate and number of years of the
loan, then calculates and prints out the monthly payment. Use p, n, r and n for the variable
names when calculating this formula. You may have other variables.
Expert's answer
#include <cstdlib>
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
double a;
double r;
int n; cout << "Input the data, please." << endl;
cout << "------------------------" << endl;
cout << " Amount: ";
cin >> a;
cout << " Interest rate: ";
cin >> r;
cout << " Number of years: ";
cin >> n;
double m = (a + a * r / 100) / (12 * n);
cout << endl << "Monthly payment: " << m << endl;
getchar(); getchar();
return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions