Home     All Articles     RSS Feed     Search     Contact

Most Recent
Rv Batteries
Travel Trailer Awnings
Trailers Utah
Small Cottage Floor Plans
Wanderlodge
Mercedes C63
Corrimal Caravans
Logitech Mouse

External Links
Marc Jacobs Shopping
HTC Touch Zone
Celebrity Resource
Cinesource
Vespa Store
Skechers Superstore
Anne Geddes Store
Fred Perry Shopping
Muscle Carts
Welterweight Online

Marketplace

14 Passenger Bus

14 Passenger BusC + + code for the system bus RESERVED

# Include "stdio.h"
# Include "string.h"
# Include "iomanip.h"
# Include "fstream.h"
# Include "conio.h"
# Include "iostream.h"
# Include "process.h"
# Include "graphics.h"
# Include "dos.h"
void presentation ();

Bus Class
(
seatno int;
Char name [20];
Int Age;
char sex;
public
booking void (int);
Void Show (int, int);
void cancel ();
void inquiry ();
void input (int);
passengerlist void ();
waitinglist void ();
B);
/ / Function to reserve a seat
empty bus:: booking (int choice)
(
clrscr ();
court <<"RESERVATION DETAILSn nnn";
cost <<"_____________________ n ";
Admission (choice);
Court <<"ENTER THE nnnt passenger name"
gets (name);
Court <<"ENTER THE nnnt age of the passenger: -";
cin>> age;
Court <<"ENTER nnnt sex of passengers: -";
cin>> sex;
fstream file;
clrscr ();
switch (choice)
(
Case 1:
file.open (bus1.dat ", ios:: app | ios:: binary);
file.write ((char *) & b, sizeof (bus));
file.close ();
show (1 seatno);
break;
Case 2:
file.open (bus2.dat ", ios:: app | ios:: binary);
file.write ((char *) & b, sizeof (bus));
file.close ();
Show (2 seatno);
break;

case 3:
Court <<"JAIPUR NNT to UDIAPURn";
court <<"t -----------------";
file.open (bus3.dat ", ios:: app | ios:: binary);
file.write ((char *) & b, sizeof (bus));
file.close ();
show (3 seatno);
break;

Box 4
Court <<"JAIPUR nnnnttt Delhi";
Cost <<"-----------------"; NTTT

file.open (bus4.dat ", ios:: app | ios:: binary);
file.write ((char *) & b, sizeof (bus));
file.close ();
show (4 seatno);
break;
default: exit (0);
)
)

empty bus:: entry (int choice)
(

FStream file1;
switch (choice)
(
Case 1:
file1.open (bus1.dat ", ios:: in | ios:: binary);
break;
Case 2:
file1.open (bus2.dat ", ios:: in | ios:: binary)
break;
case 3: file1.open (bus3.dat ", ios:: in | ios:: binary);
break;
Box 4: file1.open (bus4.dat ", ios:: in | ios:: binary);
break;
)
file1.close ();
int flag = 0;
seatno = 41;
fstream file;
if (seatno == 41 & & choice == 1)
(
for (int i = 1; i <= 40; i + +)
(File.open ("bus1.dat", ios:: in | ios:: binary);
while (file.read ((char *) & b, sizeof (bus)))
(If (i == seatno)
flag = 1;
if (flag == 1)
break;
)

if (flag == 1 & & i == 40)
(Clrscr ();
court <<"RESERVATION DETAILSn nnn";
cost <<"_____________________ n ";
Court <<"ENTER THE nnnt passenger name"
gets (name);
Court <<"ENTER THE nnnt age of the passenger: -";
cin>> age;
Court <<"ENTER nnnt sex of passengers: -";
cin>> sex;
seatno = 0;
fstream file;
file.open (waiting.dat ", ios:: app | ios:: binary);
file.write ((char *) & b, sizeof (bus));
file.close ();
Court <<"JAIPUR NNT in Dehradun;
int count1 = 0;
file.open (waiting.dat ", ios:: in | ios:: binary);
while (file.read ((char *) & b, sizeof (bus)))
(
count1 + +;
)
file.close ();
Court <<"Your expectation NNT is" <<count1;
getch
()
exit (0);
)
if (flag == 0)
(Seatno = i;
break;
)
flag = 0;
file.close ();
)
)
else if (seatno == 41 & & choice == 2)
(
fstream file;
for (int i = 1; i <= 40; i + +)
(File.open ("bus2.dat", ios:: in | ios:: binary);
.

Posted on May 25, 2010.
Share |

Comments

There are no comments.

Leave a Comment

Your Name
Your Email
Comments
Human Check. Type 6508.