Re: Simple Algorithm
savesdeday wrote:[color=blue]
>
>
> Last quick question, I am having trouble incorporating the equation to
> find the interest earned into C++. The equation is:
> Total interest earned = [(1+I/12)12 - 1]*B, and we are supposed to
> use cmath to do this. If I try to type in :
> tot_interest= (pow(1+rate/12, 12)-1)*balance
> and try to compile it, I get an error.[/color]
What error?
The compiler emits error messages to give you a hint on what is wrong
in your code. Read those error messages!
[color=blue]
> What is the correct format to
> implement the equation [(1+I/12)12 - 1]*B (using <cmath>) ?[/color]
What you have seems fine.
So what does the error message say?
--
Karl Heinz Buchegger
kbuchegg@gascad .at
savesdeday wrote:[color=blue]
>
>
> Last quick question, I am having trouble incorporating the equation to
> find the interest earned into C++. The equation is:
> Total interest earned = [(1+I/12)12 - 1]*B, and we are supposed to
> use cmath to do this. If I try to type in :
> tot_interest= (pow(1+rate/12, 12)-1)*balance
> and try to compile it, I get an error.[/color]
What error?
The compiler emits error messages to give you a hint on what is wrong
in your code. Read those error messages!
[color=blue]
> What is the correct format to
> implement the equation [(1+I/12)12 - 1]*B (using <cmath>) ?[/color]
What you have seems fine.
So what does the error message say?
--
Karl Heinz Buchegger
kbuchegg@gascad .at
Comment