OOP Report On Hostel Management System 313305 First Micro Project Msbte Store
OOP Report On Hostel Management System 313305 First Micro Project Msbte Store
Hostel is a place which is just like a second home for the people who live outside the
home. They feel safe while living in a hostel. To manage the data and information of the
person who is living in the hostel is a very complex task. It needs a lot of time from the many
people who are managing it. Our project E-Hostel Management System helps in keeping the
track of workflow taking in the hostel. The hostel staff can keep the record of hostellers and
every other detail hence helping in reducing the work of the staff as well as hostellers.
The E-Hostel Management System will work and update the hostellers records,
employees record, guest record, hostels record and hostellers fees record, hostellers
attendance record, hostel buildings(blocks) and rooms records, mess management and mess
billings and admission process, payment process can be done through online. This system
automatically calculates the hostel fees, mess bill etc.
It manages the student information, room information, room allocation details, fee
details, mess bill details and employee details of the hostel. It is also used to generate reports
of student details, fee details and mess bill details of the student.
Proposed methodology
a) To analyse the working of the hostel management system.
b) To understand the concept of the hostel management system.
c) To develop source code for management.
d) Make work easy to manage details of hostel students by creating a source code.
Resources used
3 PC windows 11 1
Features:
1. Login system
2. Enter, delete, Update data
3. Check details of existing data
4. View all records of a particular hostel
Program :
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<fstream.h>
#include<stdio.h>
class hostel
{
int room_no;
char name[30];
char address[50];
char phone[10];
public:
int main_menu ();
int add ();
int display ();
int rooms ();
int edit ();
int check(int);
int modify(int);
int delete_rec(int);
};
int hostel::main_menu ()
{
int choice=0;
while(choice!=5)
{
cout<<”\n\t\t\t\t*********”;
cout<<”\n\t\t\t\t* MAIN MENU *”;
cout<<”\n\t\t\t\t**************”;
cout<<”\n\n\n\t\t\t1.Allot A Room”;
cout<<”\n\t\t\t2.Student Record”;
cout<<”\n\t\t\t3.Rooms Alloted”;
cout<<”\n\t\t\t4.Edit Record”;
cout<<”\n\t\t\t5.Exit”;
cout<<”\n\n\t\t\tEnter Your Choice:” ;
cin>>choice;
switch (choice)
{
case1 : add ();
break;
case2 : display ();
break;
case3 : rooms ();
break;
case4 : edit ();
break;
case5 : break;
default :
{
cout<<”\n\n\t\tWrong choice!!!”;
cout<<”\n\t\tPress any let to continue!!”;
return 0;
}
}
}
return (0);
}
int hostel::add()
{
int r,flag;
ofstream fout(“Recor.dat”,ios::binary|ios::out);
cout<<:\nEnter customer details”;
cout<<”\n*************”;
cout<<”\n\n Room no:”;
cin>>r;
flag=check( r );
if(flag)
{
Cout<<”\n sorry!!!!!room is already booked”;
else
{
Room_no=r;
cout<<”\n name:\t”;
Cin>>name;
cout<<”\n Address : \t”;
cin>>address;
cout<<”\n Phone no :\t”;
cin>>phone;
cout<<endl;
fout.write((char*)this,sizeof(*this));
cout<<”\n Room is booked!!!”;
}
Cout<<”\n Press any key to continue!!!!”;
System(pause);
Fout.close();
Return 0;
}
Int hostel::display()
{
ifstream fin(“Recor.dat”,ios::binary|ios::in);
int r;
cout<<”\n Enter room no :”;
cin>>r;
while(!fin.eof())
{
Fin.read((char*)this,sizeof(*this);
if(room_no==r)
{
cout<<”\n Customer Details”;
cout<<”\n **************”;
cout<<”\n\n Room no:”<<room_no;
cout<<”\n Name:”<<name;
cout<<”\n Address:”<<address;
cout<<”\n Phone no:”<<phone no;
}
else
{
cout<<”\n Sorry Room no not found or vacant !!”;
cout<<”\n\n Press any key to continue!!!!”;
}
System(“pause”);
fin.close();
}
return 0;
}
int hostel::rooms(0
{
ifstream fin(“Recor.dat”,ios::in|ios::binary);
cout<<”\n\t\t\List of rooms allotted”;
cout<<”\n\t\t\t******************”;
cout<<”\n\n Room no.\tName\t\tAddress\t\tPhone No.\n”;
while(fin.read((char*)this,sizeof(*this))
{
cout<<”\n\n”<<room_no<<\t\t”<<name;
cout<<”\t\t”<<address<<”\t\t”<<phone;
}
cout<<”\n\n\n\t\t\tPress any key to continue!!!!”;
system(“Pause”);
fin.close;
return 0;
}
Int hostel::edit()
{
int choice,r;
cout<<”\n EDIT MENU”;
cout<<”\n*******”;
cout<<”\n\n 1.Modify Customer Record”;
cout<<”\n 2.Delete Customer Record”;
cout<<”\n Enter your choice:”;
cin>>choice;
cout<<”\n Enter room no:”;
cin>>r;
switch(choice)
{
Case1 : modify( r );
break;
case2 : delete_rec( r );
break;
default : cout<<”\n Wrong choice!!”;
}
cout<<”\n Press any key to continue!!!!!”;
return 0;
}
int hostel::check( int r )
{
int flag=0;
ifstream fin (“Recor.dat”,ios::|ios::binary);
while(!fin.eof())
{
fin.read((*char)this,sizeof(*this));
if(room_no==r)
{
Flag=1;
break;
}
}
fin.close();
return(flag);
}
Int hostel::modify(int r )
{
Long pos,flag;
fstream
file(“Record.dat”<ios::in|ios::out|ios::binary);
flag=0;
while(!file.eof());
{
Pos=file.tellg();
File.read((char*)this,sizeof(*this));
If(room_no==r)
{
cout<<”\n Enter New Details:”;
cout<<”\n***********”;
cout<<”\n Name:”;
cin>>name;
cout<<” Address:”;
cin>>address;
cout<<” Phone no:”;
cin>>phone;
file.seekg(pos);
file.write((char*)this,sizeof(*this));
cout<<”\n Record is modified!!!”;
flag=1;
break;
}
}
if(flag==0)
{
Cout<<”\n Sorry Room no not found or vacant!!”;
File.close();
return 0;
}
int hostel::delete_rec( int r )
{
int flag=0;
char ch;
ifstream fin(“Recor.dat”,ios::in|ios::binary);
ofstream fout(“temp.dat”,ios::out|ios::binary);
while(!fin.eof())
{
fin.read((char*)this,sizeof(*this));
if(room_no==r)
{
cout<<”\n Name :”<<name;
cout<<”\n Address :”<<address;
cout<<”\n Phone no :”<<phoneno;
cout<<”\n\n Do you want to delete this record(y/n):”;
cin>>ch;
if(ch==’n’)
fout.write((char*)this,sizeof(*this));
flag=1;
} else
fout.write((char*)this,sizeof(*this)); }
Fin.close();
Fout.close();
If(flag==0)
Cout<<”\n Sorry room no not found or vacant!!!!!”;
Else
{ Remove(“Recor.dat”);
Rename(“temp.dat”,”Recor.dat”);
}return 0;}
int main(){ clrscr();
hostel h;
cout<<”\n\t\t\t************”;
cout<<”\n\t\t\t*Hostel Management Project*”;
cout<<”\n\t\t\t*******************************”;
cout<<”\n\n\n\n\n\t\t\t\tPress any key to continue!!!!”;
system(“pause”);
h.main_menu();
system(“pause”);
return 0;
}
Outputs of the Micro-Projects
Skill Developed
a) Computer skills increase.
Conclusion
In conclusion, the Micro-Project on Hostel Management System using object-oriented
programming (OOP) concepts in C++ has been successfully completed. The objective of the
project was to develop a system that efficiently manages the operations and activities of a
hostel.
Throughout the project, several key features were implemented using OOP principles,
including the use of classes, objects, inheritance, and polymorphism. The system provides a
user-friendly interface and allows both the hostel staff and students to interact with it
effectively.