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

  Show with diagrams how the median filters work

Explain why in some image processing scenarios, filters are used instead of point operations on pixel values Show with diagrams how the Median Filters work

  Explaining parse tree n-m nodes

W has derivation of m steps, show that w has a parse tree n+m nodes.

  Calculate roots of function by newton-raphson approximation

Best known iterative method for calculating roots of a function f (that is, x-values for which f(x) is 0) is Newton-Raphson approximation.

  Algorithms for finding possible winers-analysing complexity

Create algorithms for finding the possible winers and the Condorcet winner with analysing its complexity.

  Information assets to estimate for risk management

If organization has three information assets to estimate for risk management as shown in accompanying data, which vulnerability must be evaluated for additional controls first?

  Explaining it acquisition issued request for proposal

A federal agency that does not use IT acquisition best practices issued a request for proposal that requires the contractor selected to use such practices, including certification at CMMI Level 3 or above.

  Writing java code by using netbeans

Write a java code using netbeans for the following program. Write a program that asks the user to enter five test scores.

  Runnig test cases on same piece of code

Why four people must waste their time looking for faults when one person can run test cases on same piece of code. How do you respond?

  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.

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Explaining responsibility ofconfidentiality to employer

Describe what you must do in such a situation. You know that cost to your present employer will increase if ambiguities are not resolved. Though, you also have a responsibility of confidentiality to previous employer.

  Explaining anticybersquatting consumer protection act

What does Anticybersquatting Consumer Protection Act perform? How does this act cut down on nuisance suits?

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