Question: NOTE: FOR CONTEXT ONLY Write a python class that satisfies the following UML diagram and has a constructor that always assigns gradePoints to and empty
NOTE: FOR CONTEXT ONLY
Write a python class that satisfies the following UML diagram and has a constructor that always assigns gradePoints to and empty dictionary {}, and allows setting of the name and major attribute via the parameter, use default values for params (your choice).

Function Breakdown: I
addGrade(...) takes a grade and a category, where the category specifies the list in the gradePoints dictionary to be added (if not in the dictionary - add a single element list)...
I getPer(...) given a grade weight dictionary compute the students percentage
I getGPA(...) return gpa such that 93 is 4. Otherwise: 4*(per-60)/33 I getLetter(...) returns the letter grade A-F
I str () function should return a string such as Name (Major)
__________________________________________________________________________________________
ACTUAL QUESTION
Write a class that satisfies the following UML diagram and has a constructor that always assigns gradeWeights to and empty dictionary {} and the students to an empty list [], and sets the allows setting of the name.

Function Breakdown:
I addStudent(...) should add the specified student to the appropriate attribute
I setGradingWeight(...) sets the weight for the grade category (adding if not in dict)
I getCourseAvgPer() returns the average across all students if the grade weights do not add to 1 (100%) then print an error message instead, and return 0.
I getCourseAvgGPA() returns the average GPA across all students if the grade weights do not add to 1 (100%) then print an error message instead, and return 0.
I printStudents() iterates through the students and prints the student objects I str () function should return a string such as Name - # Students
Write a main method in a separate file that:
I Creates one course (You set the name)
I Add grade weights: lab - 10%, test - 50%, assignments - 20%, and 20%
I Create 5 students (Set the names/majors) randomly add grades for each of the categories...or hard-code it. (looping would be useful here...each student must have at least 2 entires for each category)
I Add them to the course...
I printStudents() and the Course object.
I change the weights to: lab - 5%, test - 50%, assignments - 25%, and 20%
I printStudents() and the Course object, again
EDIT: Student class variables are posted in other question in my profile
Stuidenit gradePoints: dict name string major string + addGrade(grd:float, ctgry:string) + getPer(weighting:dict):float getGPA(weighting:dict):float +getLetter(weighting:dict): string +str() string Stuidenit gradePoints: dict name string major string + addGrade(grd:float, ctgry:string) + getPer(weighting:dict):float getGPA(weighting:dict):float +getLetter(weighting:dict): string +str() string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
