function invest (money, years, interest : real) : real var totalmoney:real:=money var count:int:=0 loop count+=1 totalmoney:= totalmoney *(1+interest) exit when count=years end loop result totalmoney end invest put invest (1000,5,0.15)