Oops
Oops
Management System
Table of Contents:
1. Introduction
2. Object-Oriented Concepts
o 2.1 Classes and Objects
o 2.2 Inheritance
o 2.3 Polymorphism
o 2.4 Encapsulation
o 2.5 Abstraction
3. Project Overview
o 3.1 Project Requirements
o 3.2 Problem Definition
o 3.3 Solution Approach
4. Detailed Analysis of the Code
o 4.1 Class Definitions
o 4.2 Member Functions
o 4.3 Object Creation and Function Calls
o 4.4 Function Flow
5. Code Walkthrough
o 5.1 Class: hotel
The main goal of the project is to manage and organize hotel data
efficiently, allowing the system to handle various tasks such as hotel
information management, manager details, staff records, and
customer bookings.
2. Object-Oriented Concepts
2.2 Inheritance
Inheritance is a key feature of OOP where one class can inherit the
properties and behaviors (methods) of another class. This promotes
code reusability and extension of existing functionality.
In this project:
2.3 Polymorphism
2.4 Encapsulation
For example, in the customer class, the customer details (like ID,
name, contact, etc.) are encapsulated within the class. The
getcust() and putcust() functions are used to interact with
this data, providing controlled access.
2.5 Abstraction
Abstraction is the concept of hiding the complex implementation
details and exposing only the necessary information to the user. In
this project, abstraction is demonstrated through the class interfaces,
where the user interacts with the methods of the classes without
needing to know the internal workings of those methods.
3. Project Overview
cpp
Copy code
class hotel
{
public:
void puthotel()
{
cout << "\n Welcome Hotel Panjabi Kitchen";
cout <<
"\n*___________________________________________
______________________________*";
cout << "\n\n\n\n Register no. = IHO-
123456";
cout << "\n Address = ****";
cout << "\n Phone no. = ****";
}
};
cpp
Copy code
class manager : public hotel
{
public:
void putmanager()
{
cout << "\n\n ID = 384756";
cout << "\n Manager = ****";
cout << "\n Contact = ****";
}
};
staff class: The staff class inherits from manager and stores
staff information, such as staff IDs and names.
cpp
Copy code
class staff : public manager
{
public:
void putstaff()
{
cout << "\n\n Staff ID = 293874";
cout << "\n Staff1 = ****";
cout << "\n\n Staff ID = 376478";
cout << "\n Staff2 = ****";
}
};
customer class: The customer class is independent and
contains customer details such as ID, name, contact, and room
number. It has methods getcust() to input customer data
and putcust() to display it.
cpp
Copy code
class custmer
{
int custmer_Id, contact, room_number;
char custmer_name[20], address[20];
public:
void getcust()
{
cout << "\n\n Enter customer id = ";
cin >> custmer_Id;
cout << "\n Enter customer name = ";
cin >> custmer_name;
cout << "\n Enter customer address = ";
cin >> address;
cout << "\n Enter customer contact no = ";
cin >> contact;
cout << "\n Enter room number = ";
cin >> room_number;
}
void putcust()
{
cout <<
"\n*___________________________________________
______________________________*";
cout << "\n\n\n Customer ID: " <<
custmer_Id;
cout << "\n Customer Name: " <<
custmer_name;
cout << "\n Customer Address: " << address;
cout << "\n Customer Contact: " << contact;
cout << "\n Customer Room: " <<
room_number;
cout <<
"\n*___________________________________________
______________________________*";
}
};
8. Conclusion
9. References