Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment you are asked to write a Python program to define a class to model some characteristics of a university Department. Specifically, the
In this assignment you are asked to write a Python program to define a class to model some characteristics of a university Department. Specifically, the class will track students requesting to major in that particular department. Students will be represented by student objects created using the Student class developed in A2 When an attempt is made to add the student to a department's major (program), the Department class will examine the Student object data and decide whether to add them to the major. If not, the class returns a response indicating rejection with a short reason why. The Department class should have, at minimum, the following methods (you may add others) Method Name Purpose Input Output/returns None Constructor - sets initial attribute values. d code and d _name are positional attributes, below@a the others are keyword with default values Displays a readable version of the Department |None object nit str Student data asa rintable string addStudentAdds qualified students to the department's Student True (added) roster of majors. Uses isQualified internalobject method to return whether qualified. False(not added)+reason isQualifiedReturns whether the student is qualified forStudentTrue (qualified) or obiect this major Prints a list of Students listed as majoring inNone this department's program False (not)+reason List of students majoring in department's program printR oster a a Attribute d code d name capaci minGPA Tvpe Definition Department code - 4 char str - valid: {ENGR, ARTS, CHHS Department name- str Maximum number of students allowed to maior in the department Incoming student's gpa must be greater than or equal to this Total number of students listed as majors for the Department object Total number of students listed as majors in all departments Average gpa of all students in department listed as its majors List containing student objects of those majoring in this department str num students univ students avgGPA roster int float List The following table shows the allowed values for each of the three Department objects Type Initial value str Attribute d code d name ARTS ARTS Art and Architecture ENGR CHHS CHHS College of Health and Human Services 10 Constructor parm. ENGR Constructor parm. Engineering capacity int Set up by in init deptartment> minGPA float Set up in init , 2.75 2.0 2.50 by department ARTS |
Step 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