Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a safe harbor 401(k) plan?30

Answered: 1 week ago