(defun construct-student (name major hw1 &optional hw2 hw3 hw4 hw5 test1 test2 classwork project final) (if (eql hw1 'withdrawn) (list (list 'name name) (list 'major major) (list 'status 'withdrawn)) (list (list 'name name) (list 'major major) (list 'homeworks (list hw1 hw2 hw3 hw4 hw5)) (list 'tests (list test1 test2)) (list 'classwork classwork) (list 'project project) (list 'final final)))) (setf students (list (construct-student '(Paul Bennett) 'CS 4.3 5.0 3.5 4.8 4.9 9.5 8.7 10.0 18 28) (construct-student '(Abe Cadman) 'CS 'withdrawn) (construct-student '(Nelson DaCunha) 'CS 4.8 4.0 4.5 3.8 5.0 8.5 9.7 10.0 17 25) (construct-student '(Susan Melville) 'CS 3.8 5.0 4.7 4.8 5.0 8.3 9.9 10.0 20 24) (construct-student '(Igor Pevac) 'CS 'withdrawn))) (defun names (students) (if (endp students) nil (cons (get-name (first students)) (names (rest students))))) (defun get-name (student) (second (assoc 'name student))) (defun clean-grade-list (grade-list) (cond ((endp grade-list) nil) ((numberp (first grade-list)) (cons (first grade-list) (clean-grade-list (rest grade-list)))) (t (clean-grade-list (rest grade-list))))) (defun get-hw2 (student) (if (eql (second (assoc 'status student)) 'withdrawn) 'withdrawn (second (second (assoc 'homeworks student))))) (defun count-w (students) (cond ((endp students) 0) ((eql (second (assoc 'status (first students))) 'withdrawn) (+ 1 (count-w (rest students)))) (t (count-w (rest students))))) (defun get-w (student) (eql (second (assoc 'status student)) 'withdrawn)) (defun search-project-20 (students) (cond ((endp students) nil) ((eql 20 (get-project (first students))) (second (assoc 'name (first students)))) (t (search-project-20 (rest students))))) (defun get-project (student) (second (assoc 'project student)))