Question: Scheme programmimg language. a) Write a function called replace-first that takes two arguments, an item and a list, and returns a version of the list
Scheme programmimg language.
a) Write a function called replace-first that takes two arguments, an item and a list, and returns a version of the list with its first element replaced by the item. If the list is empty (you can use the null? predicate to determine this) return the empty list.
b) Write a recursive function called product that takes a list of numbers as an argument and returns the result of multiplying them all together. If the list is empty, return 1.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
