Code:
#include <iostream>
#include <cmath>
int main() {
unsigned long loanAmount =
150000;
float annualInterestRate = 6.0;
unsigned short loanLength = 30;
const unsigned short
MONTHS_IN_YEAR = 12;
float monthlyInterestRate =
annualInterestRate / MONTHS_IN_YEAR;
monthlyInterestRate =
monthlyInterestRate/100;
unsigned short numberPayments =
loanLength * MONTHS_IN_YEAR;
float monthlyPayments = 1 - pow((1 +
monthlyInterestRate),
numberPayments);
monthlyPayment = monthlyInterestRate/
monthlyPayment;
monthlyPayment = loanAmount *
monthlyPayment;
std::cout << "Assuming a loan in the
ammount of £" << loanAmount
<< ", at " << annualInterestRate
<< "% interest, over " << loanlength
<< " years, the monthly payment would
be £";
std::cout.setf(std::ios_base::fixed);
std::cout.setf(std::ios_base::
showpoint);
std::cout.percision(2);
std::cout << monthlyPayment << ".\n\n";
std::cout << "Press enter or return to
continue.\n";
std::cin.get();
return 0;
}
i am getting a error on this part of the code on the top line
Code:
monthlyPayment = monthlyInterestRate/
monthlyPayment;
monthlyPayment = loanAmount *
monthlyPayment;