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

  What if the gossips about you and you rather not hear it

What if the gossip's about you and you'd rather not hear it - You've done that a few times, haven't you said things behind someone's back you wouldn't say to his face

  Create a base class for a banking account

Create a base class for a banking account. Decide what characteristics are common for checking and saving accounts and include these characteristics.

  Assess how section 508 affects developing user interfaces

building a user interface that meets the needs of a diverse population can be incredibly difficult. research the best

  Macroscopic schedule and a detailed schedule

What is the difference between a macroscopic schedule and a detailed schedule? Is it possible to manage a project if only a macroscopic schedule is developed? Why?

  Define the terms precision and reliability

Sample Evaluation. Gloria Bush has performed a sampling plan to estimate the number of children per household in her neighborhood.

  Describe four cons of virtualization

Many nameservers use a file backend configuration whereas some use a database backend allowing for instant DNS updates. Discuss some pros/cons to each.

  Write a program to implement dynamic motion specifications

Write a program to implement dynamic motion specifications. Specify a scene with two or more objects, initial motion parameters, and specified forces.

  Write a simulator for a one-way direct mapped cache

Write a simulator for a 1-way direct mapped cache. Make the number of entries and the line size parameters of the simulation. Experiment with it and report on your findings.

  Research the various features and capabilities

Research the various features and capabilities that service can provide. Discuss legal ramifications that configuring this service can have for an organization.

  Write a program that transmits a series of characters

Write a program that transmits a series of characters (in C).The sequence will consist of "AlphaNumber", where Alpha is meant to be a letter.

  What are the threat categories and associated business

The practice has a small LAN with four computers and Internet access. what are the threat categories and associated business impact for each

  Explain the osi model and data frames

Why should network architects concern themselves.

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