Question: Using python define a UniversityClass class. A university class is a course that's been scheduled for a specific semester and with a roster of students.
Using python define a UniversityClass class. A university class is a course that's been scheduled for a specific semester and with a roster of students. Define the following instance attributes. course: the Course object that this class is the offering of. semester: the string representing the semester when the class is being offered. section: which section it is. roster: a list of Student objects who are in the roster of the class.
Define the following UniversityClass instance methods:
__init__: the constructor with parameters as needed to define instance attributes.
__str__: implement this method to return a string with the course number, title, and units of the course. add: takes a Student object as a parameter and updates the roster with the student, ensuring the Student is in the roster at most once. A student is not allowed to add a class for a course they've already attempted three times before (see rules below); in this case, simply leave the roster unchanged. drop: takes a Student object as a parameter and removes it from the roster (if it's there).
Repeating course rules
Implement the following rules:
Students may repeat courses only if a D, F, WU, or NC was earned. Students are not allowed to repeat a course in which they received a grade of A, B, C or CR
If the student earns a grade of A, B, C or CR on the second attempt, the first grade earned will be excluded from the GPA; however, if a grade of less than C is earned in second attempt, both grades will be averaged into the GPA. If a grade of D, F, NC or WU is earned on the second attempt, both the original and subsequent grade will be calculated into the GPA
If a student receives approval to attempt the course for a third time, all grades in the course are averaged. Students cannot attempt a course more than three times.
A student only earns GPA points for grades: A, B, C, D. These grades still affect their GPA: F, WU. These grades have no effect on GPA: CR, NC.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
