Explaining process of making changes as recursive

Assignment Help Basic Computer Science
Reference no: EM1352540

You can view the process of making changes as recursive. You first see if any dollars are required, subtract them from the total, and then make change for what remains. The following function implements such a recursive approach to making change. The function make-change converts a given number of cents into dollars, half-dollars, quarters, and so forth.

Complete the LISP program to achieve the above requirements:

(defun make-change (money)
(cond ((>= money 100)
(cons (list (truncate money 100) 'dollars)
(make-change (rem money 100))))
((>= money 50)
(cons ....

The use of above function is:
> (make-change 123)
((1 DOLLARS) (2 DIMES) (3 PENNIES))

Reference no: EM1352540

Questions Cloud

List out three problems of decentralized power : List out three problems of decentralized power that existed under the articles of Confederation . For Each problem you listed, identify one solution that the Constitution provided to adress the problem.
Influences of environmental deprivation : Discuss the influences of environmental deprivation, deafness, and neurological disruption on language acquisition, production, and comprehension.
Determine net investment : Syracuse Roadbuilding Corporation is planning the purchase of a new tandem box dump truck. The truck costs $95,000, and an additional $5,000 is needed to paint it with the firm logo and install radio equipment.
What happen when south africa is world primary supplier : Suppose that the market for engagement rings is in equilibrium. Then political unrest in South Africa shuts down the diamond mines there. South Africa is the world's primary supplier of diamonds. What will happen.
Explaining process of making changes as recursive : You can view the process of making changes as recursive. You first see if any dollars are required, subtract them from the total, and then make change for what remains. Complete the LISP program to achieve the above requirements.
Language-learning model of either chomsky or skinner : Does the sequence support the language-learning model of either Chomsky or Skinner? Why or why not? [two references required]
Explain what provisions for liability insurance agreement : Explain What provisions (distinct parts) should always be included in a professional liability insurance agreement?
Show design of an organization : What signs might be present that a manager may be able to see whether there is a problem with the design of an organization and is changing the existing organization a different task from designing a brand new structure?
Compute the current price of common stock : The last dividend paid by xyz company was 1. XYZ growth rate is expected to be a constant 5 percent. XYZ's required rate of return on equity is 10%.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine subgame-perfect equilibrium

Targeting again one of the surviving gangsters. Survivors split money equally. Determine subgame-perfect equilibrium.

  Training data from gaussian distribution of variance

Suppose we have training data from a Gaussian distribution of known covariance S but unknown mean Mu.

  Finding content of ac and memory word at specified address

What are the content of the AC and the memory word at address 103 when the computer halts.

  Writing viruses-worms and trojan horses

Course taught students how to write viruses, worms, and Trojan Horses. It also explained the history of computer viruses as well as how to block attacks.

  Explaining seven steps of information gathering

Write and explain the seven steps of information gathering.

  Explaining physical material on which computer keeps data

Storage is the physical material on which a computer keeps data, instructions, and information?

  Explaining accuracy when using training set data

Explain what can you say about accuracy when using training set data and when using separate percentage to train?

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Explaining real-world group support system success stories

Identify one real-world Group Support System success stories (e.g., from vendor Web sites or from reports/articles) and describe them.

  Four ring architecture of operating systems

Opinion regarding what security benefit(s) would be seen if modern operating systems followed four ring architecture.

  Structured analysis and object-oriented techniques

A frequently asked question is "Can structured techniques and object-oriented techniques be mixed?

  Describe factors having greater trust in e-business

Describe the factors which would contribute to you having greater trust in e-business. Do you look for trust seals when shopping online?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd