Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (12 sloc) 1012 Bytes
;; --------------------------------------------------------
;; 3.3-pay
;; --------------------------------------------------------
;; define a function named pay that takes parameters from, to, and amount
;; use with-read to view the payments-table of the account from. bind the balance and keyset of this account to from-bal and keyset
;; enforce that the keyset is the keyset of the account
;; use with-read to view the balance of the to-bank account. bind this balance to a variable named to-bank-bal
;; enforce that the amount being transferred is greater than 0
;; enforce that the balance of the user transferring value is greater than what is being transferred
;; update payments-table to reflect the new balance of the from account.
;; update the payments-table to reflect the new balance of the to-bal account.
;; return a formatted string to say that the from account has paid the to account the amount paid
You can’t perform that action at this time.