Oop Report Final
Oop Report Final
Micro project
On
Guided By:
Scheme, MSBTE)
Sinhgad Institutes
SOU.VENUTAI CHAVAN
Program Code: CM
Program Code: CM
Certificate
This is to certify that Ms./Mr. Tanmay Sawade with Roll No. 27 of Semester
III of Diploma in Computer Technology of Institute Sou. Venutai Chavan
Polytechnic (Code : 0040 ) has successfully completed the Micro - Project in
Object Oriented Programming Using C++ (22316 ) for the academic year
2023-2024 as prescribed in the curriculum.
Program Code: CM
SR NO CONTENTS PAGE NO
2 Rationale 3
4 Literature Review 3
7 Skills Developed 14
Annexure - I
Micro-Project Proposal
Annexure - II
Micro-Project Report
1.0 Rationale:
Hostels are becoming one of the basic necessity when it comes to education
institutions . For seamless and easy experience for admissions ,one can create its
system using programming language from which Hostel management ,can be made
easy. Education is almost a basic nessecity of humanity these days and in order to
handle such a large number of students and to provide them with hosteling service, we
can take help of programming languages, from which we can create applications for
Hostel management system.
People can use services of management system in their convenience with help of this
applications.
To create such systems programming languages like C++ can perform crucial role.
Syntax:
class class_name
{
// Any variable declaration
// Any function declaration
};
E.g.:
class Book
{
string name; // variable declaration
void library(); // function declaration
};
b) File handling:
In many applications, one has to save the data or settings which has been created
by the user, because we can’t save it within the program, so to save them we need
to save it on secondary storages like Hard disk or SSD.
Our programmes run in primary memory i.e., RAM, after shutting down our
computer, all the data stored in primary storage is deleted, so in order to save
those data we can use file operation.
Using file operation, we can read as well as write to a file. And to do this in C++
we need to use a header file named “fstream.h”.
We need to declare an object first, to perform reading and writing from a file.
Object Oriented Programming Using C++ - 22316 Hostel Management System
while(object_name)
{
getline(object_name, line); // Copying word by word into array
}
object_name.close(); // closing file
Decision making statements are used in order to control and perform actions based
on different conditions. In our program we used the following conditional
statements:
Syntax:
switch(expression) {
case 1:
// Block of code to be executed if expression = 1
break;
case 2:
// Block of code to be executed if expression = 2
break;
….
case n:
// Block of code to be executed if expression = n
break;
default:
// Block of code to be executed if expression does not match any cases
}
Use the ‘if-else’ statement to specify a block of code to be executed if the condition is
true and if not, the else block code will be executed.
Syntax:
if (condition) {
} else {
}
Object Oriented Programming Using C++ - 22316 Hostel Management System
#include<iostream.h>
#include<conio.h>
class hostel
{
protected:
int bno;
int choice; float amount;
public:
void gethostel()
{
cout<<"AVAILABLE ROOMS ARE 242:";
back:
cout<<"\n***Desired hostel type 1.CLASSIC,2.REGULAR,3.NRI:*** ";
cin>>choice;
switch(choice)
{
case 1:
cout<<"**CLASSIC*AMENITIES******";
cout<<"\n=========================";
cout<<"\n FACILITY NAME and OTHER CHARGES"<<"\t charges";
Department of Computer Technology Academic Year 2023-24
Object Oriented Programming Using C++ - 22316 Hostel Management System
cout<<"\n 1.deposit "<<"\t 35000";
cout<<"\n 2.rent per month"<<"\t 5000";
cout<<"\n 3.maintenance charge"<<"\t 5000";
cout<<"\n 4.mess charges per month"<<"\t 4000";
cout<<"\n 5.admission procedure"<<"\t 2000";
cout<<"\n 5.OTHER FACILITIES INCLUDE";
cout<<"\n 6.24 hrs water supply";
cout<<"\n 7.7am to 10am hot water"<<"\t\t";
cout<<"\n 8. 24 hrs electricity supply"<<"\t";
cout<<"\n 9.personal locker and cupboard";
cout<<"\n 10.high speed elevaters";
cout<<"\n 11.3 individuals in one room";
amount=150000;
break;
case 2:
cout<<"***REGULAR*facility****";
cout<<"\n FACILITY NAME and OTHER CHARGES"<<"\t charges";
cout<<"\n 1.deposit "<<"\t 13000";
cout<<"\n 2.rent per month"<<"\t 3000";
cout<<"\n 3.maintenance charge"<<"\t 1000";
cout<<"\n 4.mess charges per month"<<"\t 4000";
cout<<"\n 5.admission procedure"<<"\t 2000";
cout<<"\n 5.OTHER FACILITIES INCLUDE";
cout<<"\n 6.24 hrs water supply";
cout<<"\n 7.24 hrs electricity supply";
cout<<"\n 8.4 individuals in one room";
amount=100000;
break;
case 3:
cout<<"***NRI**facility****";
cout<<"\n FACILITY NAME and OTHER CHARGES"<<"\t\t";
cout<<"\n 1.deposit"<<"\t 52000";
cout<<"\n 2.rent per month"<<"\t 7000";
cout<<"\n 3.maintenance charge"<<"\t 10000";
cout<<"\n 4.mess charges per month"<<"\t 6000";
cout<<"\n 5.admission procedure"<<"\t 2000";
cout<<"\n 5.OTHER FACILITIES INCLUDDE";
cout<<"\n 6.24 hrs water supply";
cout<<"\n 7.24 hrs hot water"<<"\t\t";
cout<<"\n 8. 24 hrs electricity supply"<<"\t";
cout<<"\n 9.personal locker and cupboard";
cout<<"\n 10.high speed elevaters";
cout<<"\n 11.ventilated and air conditioned rooms";
cout<<"\n 12.laundary facility";
cout<<"\n 13. cleaning workers";
cout<<"\n 14. 2 individuals in one room";
amount=220000;
Department of Computer Technology Academic Year 2023-24
Object Oriented Programming Using C++ - 22316 Hostel Management System
break;
default:
cout<<"invalid choice re-enter:";
goto back;
break;
}
previous:
cout<<"\n****enter the building number from 1 to 20:****";
cin>>bno;
if(bno<=9)
{
cout<<"SORRY! ROOMS IN THIS BUILDING ARE BOOKED ALREADY";
cout<<"available buildings\nbuilding-10\nbuilding-11\nbuilding-12\nbuilding-13\nbuilding-14\
nbuilding-15\ nbuilding-16\nbuilding-17\nbuilding-18\nbuilding-19\nbuilding-20\n";
cout<<"**please!select another building:**";
goto previous;
}
else
{
cout<<"\n\n**building selected:**\n you will get your room number soon!:\n";
}
}
void showhostel()
{
cout<<endl<<"building number:"<<bno<<endl<<"hostel type:"<<choice<<endl;
}
};
class user:public hostel
{
protected:
int age;
char name[20];
char sname[20];
public:
void getuser()
{
cout<<"***welcome to ATMOSPHERE BOYS HOSTEL***\n";
cout<<"enter the student's name:"; cin>>name;
cout<<"enter student's surname:"; cin>>sname;
back:
cout<<"enter the student's age:"; cin>>age;
if(age>=12&&age<=25)
{
cout<<"\nHURRAY!got you a room:\n";
}
else
{
Department of Computer Technology Academic Year 2023-24
Object Oriented Programming Using C++ - 22316 Hostel Management System
cout<<"SORRY! WE ACCEPT ADMISSIONS ONLY BETWEEN AGE (12-25) we don't have
rooms for your age:"<<endl;
cout<<"Enter age again:"<<endl;
goto back;
}
}
void displayuser()
{
cout<<endl<<"name:"<<name<<endl<<"age:"<<age;
}
};
Output:
12.0 Conclusion:
We learn to design Hostel Management System using C++, also we understood basic
fundamentals of hostel management systems.