I figured it out. Thanks for your help!
Type: Posts; User: white97
I figured it out. Thanks for your help!
The nbrTimesAround would be the same as the variable though. My method to put the parameters into is invest.getFutureValue(numberOfYears, numberOfTimes). So if I wrote it like you said it would have...
Yes it should change. If the user inputs number of years as 10 then it should display values 1-10 in numberOfYears in my algorithm, so:
algorithm -- principal * Math.pow((1 + interestRate /...
So even with a loop, I need to pass numberOfYears and numberOfTimes to it every time?
My algorithm method in another class is
public double getFutureValue(int numberOfYears, int numberOfTimes)
{
return principal * Math.pow((1 + interestRate / numberOfTimes), (numberOfYears *...