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
1
:
1
.
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:
1
.
You cannot use predefined functions to do the elimination. You must implement it yourself.
2
.
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.
3
.
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
2
:
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
2
Sample Run:
(
display
(
schedule 'monday
)
)
; Returns
(
(
VECTOR
-
CALCULUS
"
9
:
3
0
-
1
1
:
0
0
"
)
(
PHYSICS
"
1
1
:
0
0
-
1
2
:
0
0
"
)
(
PHYS
-
ED
"
3
:
0
0
-
4
:
0
0
"
)
)
(
display
(
schedule 'saturday
)
)
; Returns nil

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!