The Gym Membership Management System is a modular C++ application designed to digitize gym operations. It handles various membership tiers (Regular, Premium, Student), calculates fees dynamically using Operator Overloading, and ensures data persistence through file handling.
This project was developed as a case study for Object-Oriented Programming (OOP), demonstrating efficient code reusability and architecture.
| Feature | Description |
|---|---|
| 👥 Member Management | Add, Remove, and View members of different categories. |
| 💰 Smart Fee Calculation | Calculates fees based on duration, applying discounts automatically for Students or Long-term Premium members. |
| 💾 Data Persistence | Automatically saves and loads member records from a text file (members.txt). |
| 🔐 Encapsulation | Secure data handling with private attributes and public interfaces. |
| ➕ Extra Services | Ability to add optional services (like Personal Trainers) to the fee structure. |
This project is a practical implementation of the four pillars of OOP:
| Concept | Implementation in Project |
|---|---|
| Inheritance | Member (Base) → RegularMember, PremiumMember, StudentMember (Derived). |
| Polymorphism | display() and operator* are virtual functions, behaving differently based on the object type. |
| Encapsulation | All member data (Name, ID, Fee) is private; accessed only via methods to ensure integrity. |
| Abstraction | The complex logic of fee calculation and file parsing is hidden behind simple function calls in GymManager. |
| Operator Overloading | • operator*: Calculates total fee (Monthly Fee × Months).• operator+: Adds extra charges (e.g., Locker Fees). |
- A C++ Compiler (GCC, MinGW, or Clang).
- Git (optional, for cloning).
-
Clone the Repository
git clone https://github.com/hadileey/Gym-Management.git cd Gym-Management -
Compile the Code This command links the headers in the
includefolder with the logic insrc.g++ -Iinclude src/*.cpp -o gym_system -
Run the Application
- Windows:
.\gym_system.exe - Linux / Mac:
./gym_system
- Windows:
GymManagementSystem/
├── 📂 include/ # Header files (.h)
│ ├── GymManager.h
│ ├── Member.h
│ ├── PremiumMember.h
│ ├── RegularMember.h
│ └── StudentMember.h
├── 📂 src/ # Source files (.cpp)
│ ├── GymManager.cpp
│ ├── Member.cpp
│ ├── main.cpp
│ └── ...
├── 📂 data/ # Database
│ └── members.txt # Auto-generated file
└── README.mdHadil K K Computer Science & Engineering Student KIT - BE CSE B