so my buddy gave me a assignment he got a year ago in his js class that made a investment calculator

but i have most of it coded but my problem is the formula for it

this is what i was given

"code a for loop that calculates the future value of an investment"

future value = future value + (future value * annual rate / 100)

now i have

Investments

Annual interest rate

number of years

Future Value

boxes for numbers

i had tried this line of code

future_value = investment + ((investment * rate /100)*(years));

but it works but not the way it should if i put in

Investment 100000

Annual interest rate 10

years 2 it should come out to 121000 instead of 120000

so really any help would be helpful and appreciated