Question: Please include the sample codes in the programs written Please solve both questions Problem 1 : 1 . Implement a recursive function called FILTER -
Please include the sample codes in the programs written
Please solve both questions
Problem
:
Implement a recursive function called FILTER
OUT
THE in Scheme. FILTER
OUT
THE takes a list of symbols and returns a list from which all instance of the symbols THE have been removed. The prototype of FILTER
OUT
THE is:
define filter
out
the
list
your code goes here
Note:
You cannot use predefined functions to do the elimination. You must implement it yourself.
The symbol "the" is case insensitive, which means you should eliminate every instance of "the" in all forms, regardless of the combination of lower
case and upper
case.
The allowed constructs are: cond, equal, equalp, cons, car, cdr and other basic building blocks of scheme.
Sample Run:
filter
out
the
There are the boy and THE girl
Return:
THERE ARE BOY AND GIRL
Problem
:
Write a procedure called SCHEDULE that takes a weekday as an argument and retrieves a list of your commitments for that day. The procedure's prototype is:
define schedule
day
Your code goes here
Part
Sample Run:
display
schedule 'monday
; Returns
VECTOR
CALCULUS
:
:
PHYSICS
:
:
PHYS
ED
:
:
display
schedule 'saturday
; Returns nil
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
