OOP Mini Project 03
OOP Mini Project 03
🧾 Project Title:
A university wants to automate the attendance tracking of its faculty members. Each teacher's in-
time, out-time, total hours, late-ins, early-gos, short hours, and extra hours should be tracked.
Additionally, different types of staff (permanent, visiting, administrative) have different
attendance policies. The system must efficiently use inheritance to reuse code, and incorporate
constructors, destructors, objects, copy constructors, and various inheritance models (single,
multiple, multilevel, hierarchical, hybrid) with different access specifiers.
1. Class: Person
Purpose: Serves as the base class for all human entities in the system, such as teachers and
admins.
Inheritance: Base class (does not inherit from any class).
Access Specifiers & Data Members:
o protected:
string name: Name of the person.
int id: Unique ID of the person.
Member Functions:
o Person(): Default constructor.
o Person(string n, int i): Parameterized constructor.
o void getPersonalInfo(): Takes personal information from the user.
o void displayPersonalInfo(): Displays stored personal information.
o ~Person(): Destructor to clean up resources.
2. Class: TimeRecord
pg. 1
Department of Computer Science – Mini Project 03
3. Class: Attendance
Purpose: Records attendance details including late arrival, early leave, short hours, and
excess hours.
Inheritance: Publicly inherits from TimeRecord.
Access Specifiers & Data Members:
o protected:
int lateInMinutes
int earlyGoMinutes
int shortHours
int excessHours
Member Functions:
o Attendance(): Default constructor.
o void calculateLateIn(): Computes how late the teacher checked in.
o void calculateEarlyGo(): Computes early departure.
o void calculateShortAndExcessHours(): Calculates and differentiates between
shortfall and excess hours.
o void displayAttendanceReport(): Displays the full attendance details.
4. Class: Teacher
5. Class: Admin
Purpose: Administrator who can add, remove, or view teacher data and reports.
Inheritance: Publicly inherits from Person (Single Inheritance).
pg. 2
Department of Computer Science – Mini Project 03
6. Class: Department
7. Class: ReportGenerator
Purpose: Generates full attendance summaries and analytics. It compiles and analyzes teacher
attendance records, highlighting key metrics such as late-ins, early-outs, short hours, and excess
hours.
Inheritance: Publicly inherits from Teacher (can also be considered hybrid if further extended).
Access Specifiers & Data Members:
o private:
Teacher t1, t2, t3; — Stores a fixed number of teacher objects for reporting.
int teacherCount; — Maintains how many teachers are being considered.
string reportDate; — Stores the date of the report generation.
Member Functions:
o ReportGenerator() — Constructor to initialize report generator and default teacher values.
o void inputTeachers() — Takes input for teachers' attendance and personal data.
o void generateDailyReport() — Prints attendance information for the current day for all
teachers.
o void generateMonthlySummary() — Summarizes and displays cumulative attendance
statistics over a month.
pg. 3
Department of Computer Science – Mini Project 03
pg. 4