Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93082591

Have any Question?


Related Questions in Computer Engineering

Scheme questionthe following program can be used to

Scheme Question The following program can be used to determine if a given interpreter is using applicative-order evaluations or normal-order evaluation: (define (p)(p)) (define (test x y) (if (= x 0) 0 y)) (test 0 (p)) ( ...

With respect to bus request interruptswhat must be allowed

With respect to bus request interrupts: What must be allowed to complete before the interrupts is serviced? What resources (CPU, buses, memory, etc..) is the ISR expected to use? What is the ISR typically expected to do? ...

1 what is a domain name in the context of internet what

1. What is a domain name in the context of Internet? What is the procedure to get a domain name and link it to an Internet Protocol (IP) address? Use an example.

Question research and discuss strategies and techniques

Question : Research and discuss strategies and techniques for improving a web site's presence and ranking in popular search engines such as Google and Yahoo. What are some of the new form attributes in HTML5? How are the ...

A mining company wishes to start up a new small gold mine

A mining company wishes to start up a new small gold mine. The initial cost will be $5m and it is expected to extract $3m a year in gold with incurring only $1.5m a year in costs for 5 years. Assume revenue and costs are ...

What steps are required in determining the big-oh notation

What steps are required in determining the Big-Oh notation for the algorithm when sorting an array of integers 5 7 4 9 8 5 6 3 and showing the contents each time a selection sort changes it while sorting the array into a ...

Stack - java plz use simple java language netbeans 81 or

STACK - java, plz use simple java language, netbeans 8.1 or 8.2 1. Create a Stack class based on MyLinkedList class. Use this class in the following: 2. Create a new Java Application that has the following methods: 1. A ...

Step 1create a manufacturedproduct class the

Step 1 Create a ManufacturedProduct class. The ManufacturedProduct class is a simplified representation of a product that is being built on an assembly line. The data in a ManufacturedProduct object are as follows: A pri ...

Simulate by matlab then solve it theory1- using simulations

Simulate by MATLAB then solve it theory. 1- Using simulations, generate a vector of normally distributed RV X with a mean mX equals 73 and standard deviation of 20% of the mean. 2-Using simulated vectors, find the probab ...

Making note of the differences and similarities between a

Making note of the differences and similarities between a non-profit vs a for-profit organization, i.e. the user experience, the style and content what would the differences and simliarities be? I do need something to ba ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As