Question: 1. divisible-by-x? Define your own Racket function that takes an integer as an argument and returns a function that indicates whether its integer argument is

 1. divisible-by-x? Define your own Racket function that takes an integer

1. divisible-by-x? Define your own Racket function that takes an integer as an argument and returns a function that indicates whether its integer argument is evenly divisible by the first. You do not have to perform data type checking on the input. Input: An integer. Output: A function. Example: > ((divisible-by-x? 3) 12) #t ((divisible-by-x? 7) 20) #f > (define divisible-by-5 (divisible-by-x? 5)) (divisible-by-5 15) #t 2. function-9 Define a function that takes a function as an argument and passes the number 9 to that function. The function argument must be able to accept a single integer as its argument. Input: A named function which takes a single number as an argument. Output: The value returned by applying the named function to the number 9. Example: (function-9 sqrt) 3.0 > (function-9 (lambda (x) 7))) 16 > (function-9 add1) 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!