This is only my 5th program.
I am writing a program that will calculate the monthly payment on a loan.
They tell you to use the formula :
Payment = Rate * (1+Rate)^N / ((1+Rate)^N - 1) * L
N = number of payments
L = loan amount
So here is the code i wrote.
MonthlyPayment = (MonthlyIntRate * pow((1.0 + MonthlyIntRate), NumberOfPayments)) / (pow((1.0 + MonthlyIntRate),NumberOfPayments) - 1.0);
All the variables are double. And im using cmath.
The program will compile just fine, but it will only output with whatever I enter for the MonthlyIntRate.
I don't see you have included the loan amount in the code.
I missed that when I was copying, but its there and im still having the same issue.
How do you miss something with copy and paste? Paste the exact code, don't type it by hand.