Question: ;@problem 7 ( define ( three - criteria - courses c ) ( cond [ ( empty ? c ) empty ] [ else (

;@problem7
(define (three-criteria-courses c)
(cond
[(empty? c) empty]
[else
(local
[(define (fn-for-course c) ;
(cons (course-number c)(fn-for-loc (course-dependents c))))
(define (fn-for-loc loc)
(cond
[(empty? loc) empty]
[else
(cond
[cons (fn-for-course (first loc))(fn-for-loc (rest loc))])]))
;helper function to filter the an odd number course list
(define (filter-an-odd c)
(filter (lambda (x)(odd? x) c)))]
(cond
[(and (course? c)(equal? LOC0(course-dependents c)))
(filter-an-odd (courses-w-credits c 3))]
;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 (x)(equal? LOC0(last (course-dependents x))))))
((all-course-numbers c))]))]))
My question: how to extract course-dependents value when the input course is a list of course???

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!