All pastes #182325 Raw Edit

Stuff

public text v1 · immutable
#182325 ·published 2006-09-25 22:36 UTC
rendered paste body
;; Question 3

(define-struct checking (balance numberOfTransactions))
;; checking is a structure: (make-checking balance numberOfTransactions)
;; will create a checking account with a given balance and number of transactions

(define-struct savings (balance numberOfTransactions yearlyInterestRate))
;; savings is a structure: (make-savings balance numberOfTransactions yearlyInterestRate)
;; will create a savings account with a given balance, number of transactions and a
;; yearly interest rate

(define-struct credit (balance creditLimit numberOfTransactions yearlyInterestRate))
;; credit is a structure: (make-credit balance creditLimit numberOfTransactions yearlyInterestRate)
;; will create a credit account with a given balance, credit limit, number of transactions
;; and a yearly interest rate

(define (bank-of-canada-update acct newrate)
  (cond
    [(symbol=? acct 'savings) (make-savings ]
    []
    []
  )
) 

(define (withdrawal acct amt)
  ...)

(define (year-end-update acct)
  ...)