Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Functional Programming using scheme. Use Scheme and then use (Dr. Racket to test the cases) if possible. Create a function program using scheme language that

Functional Programming using scheme.

Use Scheme and then use (Dr. Racket to test the cases) if possible.

Create a function program using scheme language that takes two lists and returns a single list. For example, add the two input lists together to create one output list. Below is the test cases that should work when you type them in.

(display (vecadd '() '())) (newline) ; () (display (vecadd '(1) '(2))) (newline) ; (3) (display (vecadd '(1 2 3) '(4 5 6))) (newline) ; (5 7 9) (display (vecadd '(1 . 3) '(4 . 6))) (newline) ; (5 . 9)

Create a second function using scheme "vecfn" that allows one to pass the function to perform on the input lists as the first argument. Below are the test cases that should work when you type them in.

(display (vecfn - '(1 2 3) '(4 5 6))) (newline) (display (vecfn + '(4) (list (sqrt -1)))) (newline) (display (vecfn / '(1 2 3) '(1 4 5))) (newline)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions