in reply to Re: dividend with recursive routine
in thread dividend with recursive routine

Yeah, but I wanna practice using recursive routines. Not working out so well, though.

Replies are listed 'Best First'.
Re^3: dividend with recursive routine
by ikegami (Patriarch) on Aug 23, 2010 at 20:53 UTC

    Define your problem in terms of itself:

    To calculate the total dividends received over N periods, calculate the total dividends received over the first N-1 periods, then add the dividends received in the Nth period.

    The rest should follow.