Question: In this assignment, you will write simple SML functions that manipulate student grades in a class. Assume that a students record is represented as a
In this assignment, you will write simple SML functions that manipulate student grades in a class. Assume that a students record is represented as a quadruple of type int*string*real*real which contains the students ID, name, midtermexam grade, and finalexam grade, respectively. (2) Implement a function scores that takes a list of student records and returns a list of pairs of type int*real consisting of each students ID and composite score, respectively. (3) Implement a function getByID that takes a list of student records and an integer i and returns the record of the student whose ID is i. Assume the list contains the desired student (do not worry about the case where the desired student is not in the list). (4) Implement a function whoFailedMidterm that takes a list of student records and returns a list of the names of the students who received less than 60 on the midtermexam. (5) Implement a function allPassedFinal that takes a list of student records and returns true if all the students received a grade greater than or equal to 60 on the finalexam, and false otherwise.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
