Skip to content

Conversation

@bobbicodes
Copy link
Member

Fixes #550.

Prerequisites for Bank Account changed to "conditionals" and "numbers", which matches what other tracks have selected for this exercise.

Even that might be overkill, because the Clojure solution actually requires neither of those...

For reference, here is the example solution:

(defn open-account []
  (atom 0))

(defn close-account [acct]
  (reset! acct nil))

(defn get-balance [acct]
  @acct)

(defn update-balance [account amount]
  (swap! account + amount))

Still, I think it's probably appropriate to have some prerequisites to prevent the student from encountering this exercise too early, before they would reasonably be introduced to atoms, which don't yet have a concept exercise. In any case, this is an improvement because the exercise definitely has nothing to do with floating point.

@bobbicodes bobbicodes merged commit e2494a4 into main Oct 13, 2023
@bobbicodes bobbicodes deleted the bobbicodes-patch-2 branch October 13, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bank Account problem under wrong concept?

1 participant