bank account simulator

db4
Alex Chapman 2008-04-28 14:24:30 +10:00
parent ffd3ae635d
commit 4300eeaa89
2 changed files with 4 additions and 3 deletions

View File

@ -1,10 +1,10 @@
USING: accessors calendar kernel math money sequences ; USING: accessors calendar kernel math math.order money sequences ;
IN: bank IN: bank
TUPLE: account name interest-rate interest-payment-day opening-date transactions unpaid-interest interest-last-paid ; TUPLE: account name interest-rate interest-payment-day opening-date transactions unpaid-interest interest-last-paid ;
: <account> ( name interest-rate interest-payment-day opening-date -- account ) : <account> ( name interest-rate interest-payment-day opening-date -- account )
V{ } clone 0 pick account construct-boa ; V{ } clone 0 pick account boa ;
TUPLE: transaction date amount description ; TUPLE: transaction date amount description ;
C: <transaction> transaction C: <transaction> transaction
@ -29,7 +29,7 @@ C: <transaction> transaction
: before? ( date date -- ? ) <=> 0 < ; : before? ( date date -- ? ) <=> 0 < ;
: transactions-on-date ( account date -- transactions ) : transactions-on-date ( account date -- transactions )
[ before? ] curry subset ; [ before? ] curry filter ;
: balance-on-date ( account date -- balance ) : balance-on-date ( account date -- balance )
transactions-on-date total ; transactions-on-date total ;

1
extra/bank/summary.txt Normal file
View File

@ -0,0 +1 @@
Bank account simulator for compound interest calculated daily and paid monthly