I am currently taking a C++ class, however we are learning C before starting C++ and I am required to write a function that will calculate the intrest on a loan. I have the following information given.
float interestRate;
float interestRateGuess;
float amountOfPayment;
float loanSize;
int numberOfPayments;
/*
above values used to calculate interest rate. Below is input from user from std input.
*/
printf("Please input Loan Size:")
scanf("%f", loanSize);
printf("Please input number of payments:");
scanf("%d", numberOfPayments);
printf("Please input payment size:")
scanf("%f", amountOfPayment);
/*
code for actually locating the interest rate goes here. Using newton's method if possible.
*/
I do have functions to safely read in the data values (stored on another computer on a different network). I know how to do the loop to narrow down on the information. However, I do not know how to mathematically (or otherwise) deduce a formula to calculate the interest.
I know that using Newton's Method is the easiest way to do it, however the only way I can figure out requires having a starting point of the interest rate. How do I get a beginning starting point? Any good methods known?