Question: In this part, you will write a function student.alert (). The function simulates a simplified student grade alert system, which will evaluate a list of

 In this part, you will write a function student.alert (). The

In this part, you will write a function student.alert (). The function simulates a simplified student grade alert system, which will evaluate a list of students' grades, and return their corresponding "alert level" (more on this later) The function takes only one argument, students, which is a list of lists. Each sub-list contains one particular student's grades in the form of letter grade strings. Each letter grade has a corresponding integer value as shown below: Letter Grade Corresponding Value 95 85 75 65 Example list: ['A', 'B,'A','F', 'B', ['A', 'F', ['F,'C','D,'A', A'], ['F','F' ]] CSE 101 - Spring 2018 Lab #6 Page 1 Note that the above example list stores the grades for four students The function iterates through each student's sub-list that contains all of his/her grades, then calculates the average grade for that student. Depending on the average grade for that student, a particular character is appended to a list that the function will return: If a student's average grade is less than 70, it is considered a red alert, so the function appends 'R' to the result list If a student's average grade is at least 70 but less than 80, it is considered a yellow alert, so the function appends ' Y' to the result list . If a student's average grade is at least 80, it is considered green alert (safe), so the function appends 'G' to the result list. Eventually, the function returns a list of strings that represent the corresponding alert levels for all the students in the students list. For the example list given earlier, the average grades for the four students are 83, 75, 77 and 55, respectively. Therefore, the list returned by the function would be ['G', 'Y', 'Y','R

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 Databases Questions!