Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use the function design recipe to develop a function named sort_student_final_grade. The function has one input parameter, a list containing the student data stored as
Use the function design recipe to develop a function named sort_student_final_grade. The function has one input parameter, a list containing the student data stored as a dictionary. Sample input: [ \{ "StudentNumber": 123456 , "FirstName": "Jack", "LastName": "Jacob", "FinalGrade": 85\}, \{"StudentNumber": 100001, "FirstName": "Chris", "LastName": "Henry", "FinalGrade": 85\}, \{"StudentNumber":100000, "FirstName": "Abby", "LastName": "Brock", "FinalGrade": 77.6}, \{"StudentNumber": 100090, "FirstName": "Logan", "LastName": "Aiden", "FinalGrade": 91 \}] The function uses a bubble sorting algorithm to sort the students by FinalGrade in ascending order. Students with the same final grade should be sorted by StudentNumber number in ascending order. The function returns a list with the students' data stored in a dictionary. Sample output: [ f"StudentNumber": 100090, "FirstName": "Logan", "LastName": "Aiden", "FinalGrade": 91 \}, \{"StudentNumber":100001, "FirstName": "Chris", "LastName": "Henry", "FinalGrade": 85\}, \{"StudentNumber": 123456, "FirstName": "Jack", "LastName": "Jacob", "FinalGrade": 85\}, \{"StudentNumber":100000, "FirstName": "Abby", "LastName": "Brock", "FinalGrade": 77.6 \}] No need to write a docstring, but type annotations are required. In order to get the full marks, you need to test your function. No automated testing is required. A main script with function calls is good enough, but you must print out the student information in the following format
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started