Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Scheme/DrRacket

Name: Anonymous 2013-01-20 16:45

How do I do this without using lambda but only using local and abstract list functions?

Type Student:

;; A student is a list of the form (list id cav passed failed),
;; where
;; id is a natural number (the student id number)
;; cav is a number between 0 and 100, inclusive (student's cumulative
;; average)
;; passed is a non-negative number (number of credits student has passed) ;; failed is a non-negative number (number of credits student has failed)


Question:
Write a function candidates that consumes a list of student lists and produces a list of id numbers for students in first year whose strong academic performance makes them candidates for a university scholarship. All students who meet the following criteria are candidates:
• students are in first year (i.e. passed + failed <= 6.0 units),
• passed >= 4.5 units,
• no courses have been failed, and
• cav is at least 90% or is at least 10% higher than the average of all first year students in the list.
The produced list must be in the same relative order as the consumed list.
For example,

(candidates
   (list (list 9898 54.7 6.5 0) (list 1234 83.7 6 0)
         (list 1140 57.9 5 0.5) (list 2311 68.5 5.5 0.5)
         (list 6708 61.5 3 0.75)))
   => (list 1234)

Name: Anonymous 2013-01-21 4:24

((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((lisp and scheme is useless))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List