0% found this document useful (0 votes)
12 views22 pages

Report1 of Oop Final

The Hostel Management System is a C++ project designed to streamline student information management in hostels using Object-Oriented Programming principles. It offers functionalities such as adding, displaying, searching, modifying, and deleting student records, along with fee management and complaints handling. The system aims to improve operational efficiency, data security, and user experience while addressing specific educational needs.

Uploaded by

shreyawaykar1724
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views22 pages

Report1 of Oop Final

The Hostel Management System is a C++ project designed to streamline student information management in hostels using Object-Oriented Programming principles. It offers functionalities such as adding, displaying, searching, modifying, and deleting student records, along with fee management and complaints handling. The system aims to improve operational efficiency, data security, and user experience while addressing specific educational needs.

Uploaded by

shreyawaykar1724
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Hostel Management System

Micro-Project Report
Hostel Management System

1.0 Rational
The Hostel Management System is a project that rationalizes the process of managing student
information within a hostel. It integrates the use of Object-Oriented Programming (OOP) principles to
create a modular, scalable, and efficient system for handling various operations related to hostel
administration. The rationale behind this system can be explained by looking at the need for such a
system, the benefits it offers, and how it meets specific requirements in a real-world scenario.

2.0 Aims / Benefits of the micro-Project

1. Automate and Simplify Hostel Operations.


2. Efficient Data Management.
3. Security and Data Integrity.
4. User Friendly system.
5. Demonstrate Object-Oriented Programming (OOP) Principles.

3.0 Course Outcomes Addressed

CO Write C++ programs using classes and objects.


CO Develop C++ programs using constructors.
CO Implement Inheritance in C++.
CO Implement Polymorphism in C++.

4.0 Actual Methodology Followed

• This code is a C++ program for a Hostel Management System. Let's break down thefunctionality
and key components of the code:
• Header Files: The code includes several header files: - iostream: For input and outputoperations.
-conio.h: For console input/output operations, although this header is
non-standard and might not be available in all compilers.
-fstream: For file input/output operations.
-string: For string operations.
-string.h: This header file is included, but it's not used in the code.
• This line brings the entire ‘std’ namespace into the current scope, allowing the use ofstandard
C++ library functions without prefixing them with 'std::’.
• Class Declaration: ‘class HostelDB’ defines a class named `HostelDB` which is used tomanage
functions, a constructor.
• Structure: ‘Hostel: {}’ is a structure that initializes the student id, rooms, fees, contacts,address,
name.
• Member Functions: The class ‘HostelDB’ contains several member functions:

- Updatefile(): Updates the data in the file.


- Add(): Adds the data to the file.

Department of Computer Engineering Page |


1
Hostel Management System

- Display(): Displays the data from the file.


- Search(): Search the record.
- Modify(): Modifies the data.
- Delete(): Deletes the data from the file.
• Main Function:

- It displays the operations which are we going to perform on the data.


- It reads the student’s data, displays the data, searches for the data, modifies the data,delete the
data and exit the operations.
- We used switch case to display and do operations as per user’s need.
• File Operations:
- The program reads and writes details to the file and can also modify, display, delete andexit.
• User Interaction:
- The program interacts with the user through console input/output, allowing them toinsert,
modify, display, delete, exit.
Overall, the code is a simple implementation of a hostel management system in C++, where students
can do operations as per their need. However, there are certain areas forimprovement, such as handling
invalid input and improving the structure of the code for better readability and maintainability.
Additionally, the use of global variables and the ‘conio.h’ header may not be considered best practices
in modern C++ programming.
4.1 Data Collected
The hostel management system is a small-scale application designed to manage student details
within a hostel environment. It is developed using Object-Oriented Programming (OOP)
principles in C++ to perform essential functions such as adding new students, displaying student
details, searching for a student, modifying information, deleting records, marking fees as paid, and
adding complaints. This system provides an organized approach to handling multiple operations
efficiently.

4.2 Implementation/Coding
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Student
{
public:
int student_id;
string name;
string room_number;
bool fee_status;
string complaints;

Department of Computer Engineering Page |


2
Hostel Management System

Student(int id, string student_name, string room)


{

student_id = id;
name = student_name;
room_number = room;
fee_status = false;
complaints = "No Complaints";
}

void display()
{
cout << "Student ID: " << student_id << endl;
cout << "Name: " << name << endl;
cout << "Room Number: " << room_number << endl;
cout << "Fee Status: " << (fee_status ? "Paid" : "Unpaid") << endl;
cout << "Complaints: " << complaints << endl;
cout << "--------------------------" << endl;
}
};

class HostelManagementSystem
{
vector<Student> students;

public:
void insert_student(int id, string name, string room_number)
{
students.push_back(Student(id, name, room_number));
cout << "Student " << name << " added successfully!" << endl;

}
void display_students()
{
if (students.empty())
{
cout << "No students found." << endl;
return;
}
for (const auto &student : students) {
student.display();
}
}

int search_student(int id)


{
for (size_t i = 0; i < students.size(); ++i)
{
if (students[i].student_id == id)
{

Department of Computer Engineering Page |


3
Hostel Management System

students[i].display();
return i;
}
}
cout << "Student with ID " << id << " not found." << endl;
return -1;
}

void modify_student(int id, string new_name = "", string new_room = "")


{
int index = search_student(id);
if (index != -1)
{
if (!new_name.empty()) students[index].name = new_name;
if (!new_room.empty()) students[index].room_number = new_room;
cout << "Student " << id << " details updated successfully." << endl;
}
}

void delete_student(int id)


{
int index = search_student(id);
if (index != -1) {
students.erase(students.begin() + index);
cout << "Student with ID " << id << " removed successfully." << endl;
}
}
void pay_fees(int id)
{

int index = search_student(id);


if (index != -1) {
students[index].fee_status = true;
cout << "Fees paid for student ID " << id << endl;
}
}

void add_complaint(int id, string complaint)


{
int index = search_student(id);
if (index != -1) {
students[index].complaints = complaint;
cout << "Complaint added for student ID " << id << endl;
}
}
void exit_system()
{
cout << "Exiting system. Goodbye!" << endl;
exit(0);
}
};

Department of Computer Engineering Page |


4
Hostel Management System

void menu()
{
HostelManagementSystem hms;
int choice, id;
string name, room, complaint;

while (true)
{
cout << "\n--- Hostel Management System ---" << endl;
cout << "1. Insert Student" << endl;
cout << "2. Display All Students" << endl;
cout << "3. Search Student" << endl;
cout << "4. Modify Student Details" << endl;
cout << "5. Delete Student" << endl;
cout << "6. Pay Fees" << endl;
cout << "7. Add Complaint" << endl;
cout << "8. Exit" << endl;
cout << "Enter your choice (1-8): ";
cin >> choice;

switch (choice)
{
case 1:
cout << "Enter Student ID: ";
cin >> id;
cout << "Enter Student Name: ";
cin.ignore();
getline(cin, name);
cout << "Enter Room Number: ";
getline(cin, room);
hms.insert_student(id, name, room);
break;

case 2:

hms.display_students();
break;

case 3:
cout << "Enter Student ID to search: ";
cin >> id;
hms.search_student(id);
break;

case 4:
cout << "Enter Student ID to modify: ";
cin >> id;
cout << "Enter new name (leave blank to keep unchanged): ";
cin.ignore();
getline(cin, name);
cout << "Enter new room number (leave blank to keep unchanged): ";
getline(cin, room);
Department of Computer Engineering Page |
5
Hostel Management System

hms.modify_student(id, name, room);


break;

case 5:
cout << "Enter Student ID to delete: ";
cin >> id;
hms.delete_student(id);
break;

case 6:
cout << "Enter Student ID to pay fees: ";
cin >> id;
hms.pay_fees(id);
break;

case 7:
cout << "Enter Student ID to add a complaint: ";
cin >> id;
cout << "Enter the complaint: ";
cin.ignore();
getline(cin, complaint);
hms.add_complaint(id, complaint);
break;

case 8:
hms.exit_system();
break;

default:
cout << "Invalid choice, please try again!" << endl;
break;
}

}
}

int main()
{
menu();
return 0;
}

4.3 Result & Analysis

The development of the Hostel Management System in C++ provides a comprehensive solution to
the challenges faced in managing hostel facilities within educational institutions and other
organizations. Through the implementation of various features such as student registration, room
allocation, fee management, staff management, reporting, and security measures, the system offers an

Department of Computer Engineering Page |


6
Hostel Management System

efficient and user-friendly platform for hostel administrators to streamline their administrative
tasks.By leveraging the power of C++ programming language, the system ensures robustness,
performance, and scalability, making it suitable for deployment in diverse environments.

5.0 Actual Resource Used

Sr.No Name of Resource / material Specifications Qty Remark


11th gen RMD (TM)
1 Computer System 16GB RAM 1 used

2 Operating System Windows11 1 used

3 Printer Laser 1 used

4 Software Windows 11 1 used

6.0 Output of Micro-Projects

Department of Computer Engineering Page |


7
Hostel Management System

Department of Computer Engineering Page |


8
Hostel Management System

Department of Computer Engineering Page |


9
Hostel Management System

7.0 Skill Developed/ Learning outcome of this Micro-Project

1. Communication Skill Improved.


2. Technical proficiency.
3. Problem solving
4. Understood the basic concepts of C++.

8.0 Application of Micro-Project


1. Education Purpose
2. IQ testing
3. Booking management
4. Check-in and check-out
5. Billing and Payments

Department of Computer Engineering Page |


10
Hostel Management System

Department of Computer Engineering Page |


11
Hostel Management System

Department of Computer Engineering Page |


12
Hostel Management System

Department of Computer Engineering Page |


13
Hostel Management System

Department of Computer Engineering Page |


14
Hostel Management System

Department of Computer Engineering Page |


15
Hostel Management System

Department of Computer Engineering Page |


16
Hostel Management System

Department of Computer Engineering Page |


17
Hostel Management System

Department of Computer Engineering Page |


18
Hostel Management System

Department of Computer Engineering Page |


19
Causes of Air Pollution

Department of Computer Engineering Page |


20
Causes of Air Pollution

Department of Computer Engineering Page |


21

You might also like