0% found this document useful (0 votes)
36 views15 pages

OOP Report 2133 2134

This micro project aims to develop a bus reservation system using C++. The key features include allowing users to reserve seats by entering passenger and seat details, view available buses and seat status, and look up reservation details. The system uses classes and object-oriented concepts in C++ like inheritance, polymorphism, abstraction etc. It allows functions like installation of new bus details, seat reservation, viewing full or empty seats and available buses. This makes bus reservation faster and more convenient for passengers.

Uploaded by

Durva Yerunkar
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)
36 views15 pages

OOP Report 2133 2134

This micro project aims to develop a bus reservation system using C++. The key features include allowing users to reserve seats by entering passenger and seat details, view available buses and seat status, and look up reservation details. The system uses classes and object-oriented concepts in C++ like inheritance, polymorphism, abstraction etc. It allows functions like installation of new bus details, seat reservation, viewing full or empty seats and available buses. This makes bus reservation faster and more convenient for passengers.

Uploaded by

Durva Yerunkar
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/ 15

BHARATI VIDYAPEETH INSTITUTE OF TECHNOLOGY

(POLYTECHNIC), NAVI MUMBAI


……………………………………………………………………………………………………………………………….

Micro Project

Academic Year: 2020-21

Subject: - Object Oriented Programming Using C++ (22316)

Subject Teacher: - Suvarna Nimkarde.


Semester: - CM3I.
Title of Micro Project: - Bus Reservation System.

Roll No. Name of the Student Class

2133 Prathamesh Nipane CM3I

2134 Prathamesh Patil CM3I


CONTENT:
• INTRODUCTION
• OBJECTIVE
• DESCRIPTION OF PROJECT
• TECHNOLOGY & TOOLS USED:
• ADVANTAGE
• PROGRAM CODE
• OUTPUT
• CONCLUSION AND REFERENCE
INTRODUCTION:
This program helps us to reserve the bus seats. We have to enter seat number
and passenger name. This makes bus reservation very easy and more convenient.

OBJECTIVE:
The main objective is to make bus reservation easier. This will reduce time.

Description of project:
❖ If-else: Used to check a particular condition
❖ While, for loop: Execute some piece of code number of times.
❖ Switch: Select option and execute code regarding to selected option.

TECHNOLOGY & TOOLS USED:


C++
SOFTWARE USED: Turbo c++.

ADVANTAGE:
Helps to understand the working of a bigger program and able to solve and
understand the complex program.

Project Coding:

#include <stdio.h>
#include<conio.h>
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include<dos.h>
static int p = 0;
class a
{
char busn[5], driver[10], arrival[5], depart[5], from[10], to[10], seat[8][4][10];
public:
void install();
void allotment();
void empty();
void show();
void avail();
void position(int i);
}
bus[10];
void vline(char ch)
{
for (int i=80;i>0;i--)
cout<<ch;
}
void a::install()
{
clrscr();
cout<<"Enter bus no: ";
cin>>bus[p].busn;

cout<<"\nEnter Driver's name: ";

cin>>bus[p].driver;

cout<<"\nArrival time: ";

cin>>bus[p].arrival;

cout<<"\nDeparture: ";

cin>>bus[p].depart;

cout<<"\nFrom: \t\t\t";

cin>>bus[p].from;

cout<<"\nTo: \t\t\t";
cin>>bus[p].to;

bus[p].empty();

p++;
clrscr();
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<< "Your Booking Processing....Please wait....";
delay(2500);
clrscr();
}

void a::allotment()

{
clrscr();

int seat;

char number[5];

top:

cout<<"Bus no: ";

cin>>number;

int n;

for(n=0;n<=p;n++)

if(strcmp(bus[n].busn, number)==0)

break;
}

while(n<=p)
{

cout<<"\nSeat Number: ";

cin>>seat;

if(seat>32)

cout<<"\nThere are only 32 seats available in this bus.";

else

if (strcmp(bus[n].seat[seat/4][(seat%4)-1], "Empty")==0)

cout<<"Enter passanger's name: ";

cin>>bus[n].seat[seat/4][(seat%4)-1];

break;

else

cout<<"The seat no. is already reserved.\n";

if(n>p)
{

cout<<"Enter correct bus no.\n";

goto top;

}
delay(2000);
clrscr();

void a::empty()

{
clrscr();

for(int i=0; i<8;i++)

for(int j=0;j<4;j++)

strcpy(bus[p].seat[i][j], "Empty");

}
delay(2000);
clrscr();
}

void a::show()

{
clrscr();
int n;

char number[5];

cout<<"Enter bus no: ";

cin>>number;

for(n=0;n<=p;n++)

if(strcmp(bus[n].busn, number)==0)

break;

while(n<=p)

vline('*');

cout<<"Bus no: \t"<<bus[n].busn

<<"\nDriver: \t"<<bus[n].driver<<"\t\tArrival time: \t"

<<bus[n].arrival<<"\tDeparture time:"<<bus[n].depart

<<"\nFrom: \t\t"<<bus[n].from<<"\t\tTo: \t\t"<<

bus[n].to<<"\n";

vline('*');

bus[0].position(n);

int a=1;
for (int i=0; i<8; i++)

for(int j=0;j<4;j++)

a++;

if(strcmp(bus[n].seat[i][j],"Empty")!=0)

cout<<"\nThe seat no "<<(a-1)<<" is reserved for "<<bus[n].seat[i][j]<<".";

break;

if(n>p)

cout<<"Enter correct bus no: ";


delay(2000);
clrscr();
}

void a::position(int l)

{
clrscr();

int s=0;p=0;

for (int i =0; i<8;i++)

{
cout<<"\n";

for (int j = 0;j<4; j++)

s++;

if(strcmp(bus[l].seat[i][j], "Empty")==0)

cout.width(5);

cout.fill(' ');

cout<<s<<".";

cout.width(10);

cout.fill(' ');

cout<<bus[l].seat[i][j];

p++;

else

cout.width(5);

cout.fill(' ');

cout<<s<<".";

cout.width(10);
cout.fill(' ');

cout<<bus[l].seat[i][j];

cout<<"\n\nThere are "<<p<<" seats empty in Bus No: "<<bus[l].busn;


delay(4000);
clrscr();
}

void a::avail()

{
clrscr();
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
/*cout<<" Buses are not available during Covid-19."; */

for(int n=0;n<p;n++)

//vline('*');
cout<<" Bus- "<<n+1<<endl;
vline('*');

cout<<"---------- Bus no: \t"<<bus[n].busn<<" ----------"<<"\nDriver: \t"<<bus[n].driver

<<"\t\tArrival time: \t"<<bus[n].arrival<<"\tDeparture Time:


"<<bus[n].depart<<"\nFrom: \t\t"<<bus[n].from<<"\t\tTo: \t\t\t"

<<bus[n].to<<"\n";

vline('*');
vline('_');

}
delay(9600);
clrscr();
}

void main()

system("cls");

int w;

while(1)

//system("cls");
cout<<"\n";
vline('*');

cout<<"\n";

cout<<"\t\t\t1.Install\n\t\t\t"

<<"2.Reservation\n\t\t\t"

<<"3.Show\n\t\t\t"

<<"4.Buses Available. \n\t\t\t"

<<"5.Exit";

cout<<"\n\t\t\tEnter your choice:-> ";

cin>>w;
cout<<"\n\n\n\n";
vline('*');

switch(w)

case 1: bus[p].install();

break;

case 2: bus[p].allotment();

break;

case 3: bus[0].show();

break;

case 4: bus[0].avail();

break;

case 5: exit(0);

}
// vline('*');

getch();

Program Output:
Conclusion:
Bus reservation system is very helpful for those people who use buses for travelling so it is
important to save their time from buying the tickets. This program helps them to reserve
the seats fast. This program also shows which buses are available and what is its arriving
and departure time. By knowing the time people can manage their time.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy