Question: For this assignment you will compare a Functional and an Imperative language. Write a program in Scheme and one program in OCaml that reverses a

For this assignment you will compare a Functional and an
Imperative language.
Write a program in Scheme and one program in OCaml that reverses
a string (a list in Scheme). The OCaml must use recursion.
You cannot use any built-in function to reverse lists. You need
to write the recursive functions.
For example, using as input a string (a list)a b c d, the
program should return d c b a
Take screenshots of your programs and their execution.
Answer the following questions. Write a comprehensive answer
showing your ideas.
Do you think Functional programming languages should be used
instead of imperative languages?
Which of both programs do you think is more efficient? Why do
you think that?
Do you think Functional programming languages are easier to
read than imperative languages?

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 Programming Questions!