Assignment: Build a Mini University Management System
Scenario:
You are hired to build a simplified university management system. You need to design a
structure using Inheritance and Interfaces that models the following components:
• Person (base abstract class): common to all entities like Student, Teacher, Admin.
• Student, Teacher, and Admin (derived from Person).
• IExam, ICourse, and IReport (interfaces with different responsibilities).
• ResultProcessor (class that implements multiple interfaces).
• DepartmentHead class that extends Teacher and adds unique behavior.
• A sealed class SystemAdmin that shouldn't be extended further.
Requirements:
1. Abstract Base Class: Person
• Fields: Name, Email, Age
• Protected Field: ID
• Constructor to initialize common values
• Abstract Method: DisplayInfo()
2. Derived Classes: Student, Teacher, Admin
• Student:
o Fields: RollNumber, Course
o Overrides DisplayInfo()
o Method: SubmitExam()
• Teacher:
o Fields: Subject, Salary
o Overrides DisplayInfo()
o Method: AssignGrades()
• Admin:
o Fields: Designation
o Overrides DisplayInfo()
o Method: GenerateReports()
3. Interfaces
• IExam:
o void StartExam()
o void SubmitExam()
• ICourse:
o void EnrollCourse(string course)
• IReport:
o void GenerateReports()
4. Class ResultProcessor
• Implements IExam, IReport
• Demonstrates interface method implementation
5. Multilevel Inheritance
• DepartmentHead : inherits from Teacher
• Adds DepartmentName field
• Overrides DisplayInfo() and uses base.DisplayInfo() to reuse parent implementation
6. Hierarchical Inheritance
• Already shown via Student, Teacher, Admin inheriting from Person
7. Multiple Inheritance via Interface
• Create class AcademicAssistant that implements both ICourse and IExam
8. sealed class: SystemAdmin
• Contains method MaintainSystem()
9. Use of base keyword
• Used in constructors and overridden methods
Hints:
• Use abstract for methods in Person so that child classes must implement them.
• Use override when redefining DisplayInfo() in derived classes.
• Use base.DisplayInfo() to call parent method from child.
• Implement interface methods explicitly in one class and implicitly in another to show
both styles.
• Remember that sealed classes cannot be inherited.
• ResultProcessor can work on both Students and Teachers' reports.
• Use access modifiers properly: private for internal data, protected for inherited access,
public for general access.
Expected Output (Sample Flow):