Question: ( define ( three - criteria - courses c ) ( cond [ ( empty ? c ) empty ] [ else ( local [

(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
(cons (fn-for-course (first loc))(fn-for-loc (rest loc)))]))
(define (filter-an-odd c)
(filter (lambda (x)(odd? x)) c))
(define (extract-course-dependents courses)
(map course-dependents courses))
(define (every predicate lst)
(cond
[(empty? lst) #t]
[(predicate (first lst))(every predicate (rest lst))]
[else #f]))]
(cond
[(and (course? c)(equal? LOC0(course-dependents c)))
(filter-an-odd (courses-w-credits c 3))]
[(and (list? c)(every (lambda (x)(equal? LOC0(last (course-dependents x)))) c))
(all-course-numbers c)]))])), output error expected: and/c list? not/c empty given:'(), the main issue how to extract course-dependents from the 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!