Question: ;; Design a function that consumes a course and produces the numbers of ;; all courses in the tree that: ;; have an odd course
;; Design a function that consumes a course and produces the numbers of
;; all courses in the tree that:
;; have an odd course number, and
;; are not prerequisites for any other courses in the tree, and
;; are worth at least credits.
;;
;; You should produce a design for a single toplevel function called
;; threecriteriacourses, below is my coding: ;@problem
define threecriteriacourses c
cond
empty c empty
else
local
define fnforcourse c ;
cons coursenumber cfnforloc coursedependents c
define fnforloc loc
cond
empty loc empty
else
cond
cons fnforcourse first locfnforloc rest loc
;helper function to filter the an odd number course list
define filteranodd c
filter lambda xodd x c
cond
and course cequal LOCcoursedependents c
filteranodd courseswcredits c
;helper function to filter the an odd number course list
;filter the list of course where the dependents is null, return this list.
and course list? map lambda xequal LOClast coursedependents x
allcoursenumbers c
My code as above could not run, how to rectify it
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
