Define the function payback

Assignment Help Computer Engineering
Reference no: EM132095120

Please answer these questions using Scheme code:

Some credit-card companies pay back a small portion of the charges a customer makes over a year.

One company returns

(a) 0.25% for the first $500 of charges,

(b) 0.50% for the next $1000 (that is, the portion between $500 and $1500),

(c) 0.75% for the next $1000 (that is, the portion between $1500 and $2500),

(d) and 1.0% for everything above $2500.

Thus, a customer who charges $400 a year receives $1.00, which is 0.25% * 400, and one who charges $1,400 a year receives $5.75, which is 1.25 = 0.25% * 500 for the first $500 and 0.50% * 900 = 4.50 for the next $900. Define the function payback, which consumes a charge amount and computes the corresponding pay-back amount.

Code the Ackermann function in DrRacket, which is defined as follows: A(m, n) = n + 1 if m = 0, A(m - 1, 1) if m > 0 and n = 0 A(m - 1, A(m, n - 1)) if m > 0 and n > 0

To check your result, use DrRacket to compute the result of A(3, 4), which should be 125.

John McCarthy is a famous computer scientist who designed LISP. He once proposed a function called the McCarthy 91 function, defined as follows: Mac(n) = ( n - 10 if n > 100 Mac(Mac(n + 11)) if n = 100

Write this function in Scheme. Try calling the function with a few numbers less than 100 and see what the results are.

Write a higher-order function mult n that takes an integer n as a parameter and returns a function, which multiples its parameter by n.

Thus, ((mult n 3) 2) = 6 and ((mult n -2) 3) = -6.

Reference no: EM132095120

Questions Cloud

Generate a conceptual model for an emergency : Use the tool to generate a conceptual model for an emergency room. Keep in mind that you are not modeling a process
Hawk electronics case : Review the case and provide an analysis of the case using the following case questions prompts for guidance. Your paper should be no less than
Write a program with class that implements a deque : Write a program with class that implements a deque that stores strings using a doubly-linked list that you code yourself.
Describe the impact of access control methods : Describe the impact of access control methods and models in obtaining evidence of sufficient quality to be accepted by a court.
Define the function payback : Define the function payback, which consumes a charge amount and computes the corresponding pay-back amount.
Have you considered teaching project management : Have you considered teaching project management as a part-time or full-time career? Do you want to know what goes on behind
Print the weighted moving average of all the trades : You are given a series of trades. Each trade has a key, a value, a quantity, and a sequence number.
Navigate a challenging organizational landscape : -When Mulcahy became COO, in what ways did she use EQ and AL to navigate a challenging organizational landscape? Explain your reasoning.
Prepare two income statements showing the byproduct : Prepare two income statements (1) showing the byproduct as a cost reduction during production, and (2) the byproduct as a revenue item when sold

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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