% Simple present value calculation program var R : real var i : real var n : real var c : real var res : real % Set values up here R := 800 % amount of the monthly investment, in dollars i := 0.2 % compound percentage n := 7 % period of time (years) c := 1 % compound frequency % Calculate crap. This has been split over two lines to reduce complexity res := R * ((1 - (1 + (i / c)) * exp (-n * c))) res := res / (i / c) put "Result is ", res