Question: Please write two functions that calculate your score average for your quizzes and assignments. The student scores will be read from a input.txt file that
Please write two functions that calculate your score average for your quizzes and assignments. The student scores will be read from a input.txt file that you create which has your grades in the following format: Student id, then your 10 quiz scores, then your 13 assignment scores, all semi-colon (;) separated: StudentID;Quiz1;Quiz2;Quiz3;Quiz4;Quiz5;Quiz6;Quiz7;Quiz8;Quiz9;Quiz10;Assignment1;Assi gnment2;Assignment3;Assignment4;Assignment5;Assignment6;Assignment7;Assignment8;Assi gnmentX1;AssignmentX2;AssignmentX3;AssignmentX4;AssignmentX5 For example, a student with id 1111111111 who has the following grades:
Would have a single line of entry in their input.txt file: 1111111111;0;100;0;100;80;60;80;90;20;100;0;0;0;75;80;100;85;50;0;20;50;60;100
Your first function (studentDictFromFile())needs to read from this file (in the same folder with the code) in order to fill a dictionary with student id as a key which has a two dimensional list as variables for you quizzes and assignments
The output of this first function needs to be the dictionary you have filled in based on the Count 1 2 3 4 5 6 7 8 9 10 Quizzes 0 100 0 100 80 60 80 90 20 100 Assignments 0 0 0 75 80 100 85 50 AssignmentsX 0 20 50 60 100 input.txt contents. Note that you have a list for your quiz scores, a list for your assignments and a list for your extra assignments (AssignmentX) inside a single list. For the given example, the dictionary format is: {1111111111: [[0, 100, 0, 100, 80, 60, 80, 90, 20, 10], [0, 0, 0, 75, 80, 100, 85, 50], [0, 20, 50, 60, 100]]} Your second function (calculateAverageGrades(inputDictionary)) should calculate the average score for your quizzes and assignments once this dictionary is given as an input. Your quiz averages should be the average of your best 8 quizzes (Note that this list is not ordered). For the assignments, you need to get the average of the best 8 scores from assignments and assignmentX lists. The average scores should be printed to the screen with the student ID.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
