Function for intrest rate (C not C++ please)

May 27, 2013 at 3:42am
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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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?
May 27, 2013 at 4:41am
Topic archived. No new replies allowed.