Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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).

image text in transcribed

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.

image text in transcribed

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() string

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 3 Lnai 6323

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

3642159389, 978-3642159381

More Books

Students also viewed these Databases questions

Question

b. Where did they come from?

Answered: 1 week ago