Question
Write a python class that satisfies the following UML diagram and has a constructor that always assigns gradePoints to and empty dictionary {}, and allows
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)
___________________________________________________________________________
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
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() stringStep 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