USING: io kernel math math.parser ; IN: payments : interest-rate ( -- rate ) .02 12 / ; : initial-balance 500 ; : total-to-pay 587 ; : number-of-payments 6 ; : monthly-payment ( -- payment ) total-to-pay number-of-payments / ; : collect-interest ( balance -- new-balance ) dup interest-rate * + ; : payment ( balance -- new-balance ) collect-interest monthly-payment - ; : do-it ( -- ) initial-balance number-of-payments [ payment ] times number>string print ; MAIN: do-it