6.7

Assignment 11

home work!

Programming Language ISL

Due Date Thurs 2/23 at 11:59pm

Possible Points 33

Purpose To begin using abstraction.

Graded Exercises

Exercise 1 Design a function that given a list of natural numbers will output 2 raised to the power of every element in the list.

Exercise 2 Design a function that given a list of natural numbers will output the factorial of each number. Refer to assignment 7 for a definition of natural numbers. For more information on factorial, see here.

Exercise 3 Design an abstraction apply-to-all that abstracts over these two functions. Then, comment out your past definitions and redefine them using apply-to-all. Your tests should still pass.

Exercise 4 Use apply-to-all to design a function that takes a list of strings and appends "cat" to all of them.

Exercise 5 Give the most abstract signature for the following function:
(define (f a b c)
 (c (a b) b))