Question: Question 1 (A) Write Scheme code that creates the following: [3 marks] A cons pair of two numbers A list of 3 numbers, using only

Question 1

(A) Write Scheme code that creates the following: [3 marks]

A cons pair of two numbers

A list of 3 numbers, using only the cons function.

A list containing a string, a number and a nested list of three numbers, using only the cons function.

A list containing a string, a number and a nested list of three numbers, using only the list function.

A list containing a string, a number and a nested list of three numbers, using only the append function.

(B) Comment on result. Mention the difference between the cons, list and append functions. [3 marks]

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!