Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

Need help implenting the classes below in Python 3

Please take a close look at the UML diagram as well as the descriptions of the classes.

 

### Class Diagram for University Management System

#### University
- **Attributes:**
  - `name: string`
  
- **Methods:**
  - `__str__()`: Returns a string representation.
  - `add_undergrad(name, email, gpa)`: Adds an undergraduate student.
  - `add_graduate(name, email, level)`: Adds a graduate student.
  - `add_course(...)`: Adds a course.
  - `remove_student(name): list`: Removes a student.
  - `get_students(name, id, email): list`: Retrieves a list of students by name, ID, or email.
  - `get_courses(subject, number, title): list`: Retrieves a list of courses.
  - `enroll_student(id, subject, number)`: Enrolls a student in a course.
  - `enrollment_report(): dict`: Generates an enrollment report.

#### Course
- **Attributes:**
  - `subject: string`
  - `number: int`
  - `title: string`

- **Methods:**
  - `__str__()`: Returns a string representation.

#### Student
- **Attributes:**
  - `name: string`
  - `id: string`
  - `email: string`

- **Methods:**
  - `reset_id_numbering()`: Resets the ID numbering system.
  - `get_standing(): string`: Returns the academic standing.
  - `enroll_to(Course)`: Enrolls the student in a course.
  - `__str__()`: Returns a string representation.

#### UnderGrad (Inherits from Student)
- **Attributes:**
  - `gpa: float`

- **Methods:**
  - `get_standing(): string`: Returns the academic standing of an undergraduate student.
  - `__str__()`: Returns a string representation.

#### Graduate (Inherits from Student)
- **Attributes:**
  - `current_level: string`

- **Methods:**
  - `get_standing(): string`: Returns the academic standing of a graduate student.
  - `__str__()`: Returns a string representation.

### Relationships:
- **University** has a one-to-many relationship with **Courses** (denoted by 1 to * on the diagram).
- **University** also has a one-to-many relationship with **Students**.
- **Students** have a many-to-many relationship with **Courses
expand button
Transcribed Image Text:### Class Diagram for University Management System #### University - **Attributes:** - `name: string` - **Methods:** - `__str__()`: Returns a string representation. - `add_undergrad(name, email, gpa)`: Adds an undergraduate student. - `add_graduate(name, email, level)`: Adds a graduate student. - `add_course(...)`: Adds a course. - `remove_student(name): list`: Removes a student. - `get_students(name, id, email): list`: Retrieves a list of students by name, ID, or email. - `get_courses(subject, number, title): list`: Retrieves a list of courses. - `enroll_student(id, subject, number)`: Enrolls a student in a course. - `enrollment_report(): dict`: Generates an enrollment report. #### Course - **Attributes:** - `subject: string` - `number: int` - `title: string` - **Methods:** - `__str__()`: Returns a string representation. #### Student - **Attributes:** - `name: string` - `id: string` - `email: string` - **Methods:** - `reset_id_numbering()`: Resets the ID numbering system. - `get_standing(): string`: Returns the academic standing. - `enroll_to(Course)`: Enrolls the student in a course. - `__str__()`: Returns a string representation. #### UnderGrad (Inherits from Student) - **Attributes:** - `gpa: float` - **Methods:** - `get_standing(): string`: Returns the academic standing of an undergraduate student. - `__str__()`: Returns a string representation. #### Graduate (Inherits from Student) - **Attributes:** - `current_level: string` - **Methods:** - `get_standing(): string`: Returns the academic standing of a graduate student. - `__str__()`: Returns a string representation. ### Relationships: - **University** has a one-to-many relationship with **Courses** (denoted by 1 to * on the diagram). - **University** also has a one-to-many relationship with **Students**. - **Students** have a many-to-many relationship with **Courses
### Instance Attributes and Properties
- **Protect the data to ensure encapsulation.**
- **Implement properties for all instance attributes unless noted.**

### Student
- Student is an abstract class that represents general students. *Implement it as guided on exercise 10.26 on page 428 in the textbook.*
- Properties are read-only.
- Email data should be validated in the form of "<any text>@ucdenver.edu", and should be all lowercase.
- Add the constructor to initialize all data.
- When a Student user is created, the ID should be generated automatically in sequence. The first student ID should be "000001" and increment by 1 once a new student object is created.
- The `reset_id_numbering` class method should reset the numbering of the IDs, restarting to 1.
- Students can be enrolled in one or more courses, or not enrolled at all. `enroll_to` receives a course object and adds it to the `enrolled_to` list.

### UnderGrad:
- Undergraduate students.
  - **GPA should be between 0 and 4**
  - **Standing is "Undergraduate"**
  - **Add constructor to initialize all data properly**

### Graduate:
- Graduate (master/phd) students
  - **Standing is "Master" or "PhD" depending on the current level.**
  - **Current level represents either "master" or "phd"**
  - **Add constructor to initialize all data properly**
expand button
Transcribed Image Text:### Instance Attributes and Properties - **Protect the data to ensure encapsulation.** - **Implement properties for all instance attributes unless noted.** ### Student - Student is an abstract class that represents general students. *Implement it as guided on exercise 10.26 on page 428 in the textbook.* - Properties are read-only. - Email data should be validated in the form of "<any text>@ucdenver.edu", and should be all lowercase. - Add the constructor to initialize all data. - When a Student user is created, the ID should be generated automatically in sequence. The first student ID should be "000001" and increment by 1 once a new student object is created. - The `reset_id_numbering` class method should reset the numbering of the IDs, restarting to 1. - Students can be enrolled in one or more courses, or not enrolled at all. `enroll_to` receives a course object and adds it to the `enrolled_to` list. ### UnderGrad: - Undergraduate students. - **GPA should be between 0 and 4** - **Standing is "Undergraduate"** - **Add constructor to initialize all data properly** ### Graduate: - Graduate (master/phd) students - **Standing is "Master" or "PhD" depending on the current level.** - **Current level represents either "master" or "phd"** - **Add constructor to initialize all data properly**
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY