Question
I need to use clojure. Do not use any of the built-in Clojure functions/macros except: def, defn, fn, if, cond, let, arithmetic operations, comparison operations,
I need to use clojure. Do not use any of the built-in Clojure functions/macros except: def, defn, fn, if, cond, let, arithmetic operations, comparison operations, and, or, not, str, conj, cons, first, rest, nth, zero?, empty?, nil?, odd?, even?, assoc Define a function (deposit account amount) that accepts a map, account, and a number, amount, as arguments. The map account will map the keyword :balance to a number. Your function deposit must return a new map with the :balance value increased by amount, if amount is positive or unchanged (if amount is not positive). > (deposit {:owner "Jo", :id 12983, :balance 1000} 150) {:owner "Jo", :id 12983, :balance 1150} > (deposit {:owner "Jim", :id 7187, :balance 3000} 89) {:owner "Jim", :id 7187, :balance 3089} > (deposit {:owner "Becky", :id 111, :balance 2000} -3) {:owner "Becky", :id 111, :balance 2000} > (deposit {:balance 33} 5) {:balance 38}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started