#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.setf(ios::fixed); cout.precision(2); cout << endl << "Monthly payment: " << m << endl; getchar(); getchar(); return 0; }
Comments