Archit Pro-1 PDF
Archit Pro-1 PDF
Archit Pro-1 PDF
CERTIFICATE
2. ACKNOWLEDGEMENT
3. INTRODUCTION TO THE PROGRAM
4. HARDWARE & SOFTWARE REQUIREMENTS
5. SOURCE CODE
6. SCREEN SHOTS
7. REFRENCES
8. LINKS
This is to certify that Archit Agrawal of class 12th B has
satisfactorily completed the project in Computer Science
in the academic year 2019-20. I have examined the
project and hereby accord my approval of it as a study
carried out and presented in the manner required for its
acceptance. This does not necessarily endorse or accept
every statement made or opinion expressed or
conclusion drawn, but only signifies the acceptance of the
project for the purpose it is submitted for.
• Ram: 1 GB or more
• ADO.NET
• HTML
Source Code
#include <iostream.h>
#include <fstream.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <dos.h>
class TICKET
{
public :
void ADDITION(void) ;
void ENQUIRY(void) ;
char *FLIGHTNO(int) ;
private :
void ADD_RECORD(char[10], char[15], char[15], int, int) ;
protected :
char fltno[10], from[15], to[15] ;
int ecofair, exefair ;
};
class PASSANGER
{
public :
void ADD_RECORD(int, int, char[26], char[36], int, char, char) ;
void DELETE_TICKET(int) ;
int DELETE_FLIGHT(int) ;
void LIST(void) ;
int LAST_TICKETNO(void) ;
int SEATS(int) ;
int FOUND(int) ;
char *NAME(int) ;
protected :
char Class, name[26], address[36], sex ;
int slno, age, ticketno ;
};
void TICKET :: ADD_RECORD(char t_fltno[10], char t_from[15], char t_to[15], int t_ecofair, int
t_exefair)
{
fstream file ;
file.open("TICKET.DAT", ios::app) ;
strcpy(fltno,t_fltno) ;
strcpy(from,t_from) ;
strcpy(to,t_to) ;
ecofair = t_ecofair ;
exefair = t_exefair ;
file.write((char *) this, sizeof(TICKET)) ;
file.close() ;
}
char *TICKET :: FLIGHTNO(int sno)
{
fstream file ;
file.open("TICKET.DAT", ios::in) ;
int count=1 ;
while (file.read((char *) this, sizeof(TICKET)))
{
if (sno == count)
break ;
count++ ;
}
file.close() ;
return fltno ;
}
temp.close() ;
file.open("PASS.DAT", ios::out) ;
temp.open("temp.dat", ios::in) ;
temp.seekg(0,ios::beg) ;
while ( !temp.eof() )
{
temp.read((char *) this, sizeof(PASSANGER)) ;
if ( temp.eof() )
break ;
file.write((char *) this, sizeof(PASSANGER)) ;
}
file.close() ;
temp.close() ;
}
int PASSANGER :: DELETE_FLIGHT(int sno)
{
fstream file ;
file.open("PASS.DAT", ios::in) ;
fstream temp ;
temp.open("temp.dat", ios::out) ;
file.seekg(0,ios::beg) ;
int found = 0 ;
while (!file.eof())
{
file.read((char *) this, sizeof(PASSANGER)) ;
if (file.eof())
break ;
if (sno != slno)
temp.write((char *) this, sizeof(PASSANGER)) ;
else
found = 1 ;
}
file.close() ;
temp.close() ;
file.open("PASS.DAT", ios::out) ;
temp.open("temp.dat", ios::in) ;
temp.seekg(0,ios::beg) ;
while ( !temp.eof() )
{
temp.read((char *) this, sizeof(PASSANGER)) ;
if ( temp.eof() )
break ;
file.write((char *) this, sizeof(PASSANGER)) ;
}
file.close() ;
temp.close() ;
return found ;
}
void RESERVE :: CANCELLATION(void)
{
clrscr() ;
char t1[10], ch ;
int t2, tno, valid ;
do
{
valid = 1 ;
gotoxy(3,23) ; clreol() ;
cout <<"PRESS <ENTER> TO SEE LIST or 0 TO EXIT" ;
gotoxy(3,20) ; clreol() ;
cout <<"Enter Ticket no. of the Passanger to cancel the Ticket " ;
gets(t1) ;
t2 = atoi(t1) ;
tno = t2 ;
if (t1[0] == '0')
return ;
if (strlen(t1) == 0)
{
valid = 0 ;
LIST() ;
clrscr() ;
}
if (!FOUND(tno) && valid)
{
valid = 0 ;
gotoxy(3,23) ; clreol() ;
cout <<"\7Record not found" ;
getch() ;
}
} while (!valid) ;
clrscr() ;
fstream file ;
file.open("PASS.DAT", ios::in) ;
while (file.read((char *) this, sizeof(PASSANGER)))
if (ticketno == tno)
break ;
file.close() ;
int i=1 ;
file.open("TICKET.DAT", ios::in) ;
while (file.read((char *) this, sizeof(TICKET)))
{
if (slno == i)
break ;
i++ ;
}
file.close() ;
PASSANGER p ;
gotoxy(33,6) ;
cout <<"Ticket no. " <<tno ;
gotoxy(17,9) ;
cout <<from <<" to " <<to ;
gotoxy(45,9) ;
cout <<"Flight no. " <<fltno ;
gotoxy(20,11) ;
cout <<"Passanger Name : " <<p.NAME(tno);
gotoxy(20,13) ;
cout <<"Address : " <<address ;
gotoxy(20,15) ;
cout <<"Sex : " <<sex ;
gotoxy(20,17) ;
cout <<"Age : " <<age ;
gotoxy(45,19) ;
if (Class == 'E')
cout <<"Total Fair: " <<ecofair ;
else
cout <<"Total Fair: " <<exefair ;
do
{
gotoxy(10,23) ; clreol() ;
cout <<"Cancel this ticket (y/n) : " ;
ch = getche() ;
ch = toupper(ch) ;
} while (ch != 'Y' && ch != 'N') ;
if (ch == 'N')
return ;
DELETE_TICKET(tno) ;
gotoxy(10,25) ;
cout <<"\7Ticket Cancelled" ;
getch() ;
}
void RESERVE :: DISPLAY_TICKET(void)
{
clrscr() ;
char t1[10], ch ;
int t2, tno, valid ;
do
{
valid = 1 ;
gotoxy(3,23) ; clreol() ;
cout <<"PRESS <ENTER> TO SEE LIST or 0 TO EXIT" ;
gotoxy(3,20) ; clreol() ;
cout <<"Enter Ticket no. of the Passanger " ;
gets(t1) ;
t2 = atoi(t1) ;
tno = t2 ;
if (t1[0] == '0')
return ;
if (strlen(t1) == 0)
{
valid = 0 ;
LIST() ;
clrscr() ;
}
if (!FOUND(tno) && valid)
{
valid = 0 ;
gotoxy(3,23) ; clreol() ;
cout <<"\7Record not found" ;
getch() ;
}
} while (!valid) ;
clrscr() ;
fstream file ;
file.open("PASS.DAT", ios::in) ;
while (file.read((char *) this, sizeof(PASSANGER)))
if (ticketno == tno)
break ;
file.close() ;
int i=1 ;
file.open("TICKET.DAT", ios::in) ;
while (file.read((char *) this, sizeof(TICKET)))
{
if (slno == i)
break ;
i++ ;
}
file.close() ;
PASSANGER p ;
gotoxy(33,6) ;
cout <<"Ticket no. " <<tno ;
gotoxy(17,9) ;
cout <<from <<" to " <<to ;
gotoxy(45,9) ;
cout <<"Flight no. " <<fltno ;
gotoxy(20,11) ;
cout <<"Passanger Name : " <<p.NAME(tno);
gotoxy(20,13) ;
cout <<"Address : " <<address ;
gotoxy(20,15) ;
cout <<"Sex : " <<sex ;
gotoxy(20,17) ;
cout <<"Age : " <<age ;
gotoxy(45,19) ;
if (Class == 'E')
cout <<"Total Fair: " <<ecofair ;
else
cout <<"Total Fair: " <<exefair ;
gotoxy(10,25) ;
cout <<"Press any key to continue..." ;
getch() ;
}
void RESERVE :: DELETE_ALL(void)
{
clrscr() ;
ENQUIRY() ;
char t1[5] ;
int t2, valid, sno ;
do
{
valid = 1 ;
gotoxy(3,23) ;
cout <<" ";
gotoxy(3,23) ;
cout <<"PRESS <ENTER> TO EXIT" ;
gotoxy(3,20) ;
cout <<" ";
gotoxy(3,20) ;
cout <<"Enter Sno. of the FLIGHT for which all passanger records to be deleted : " ;
gets(t1) ;
t2 = atoi(t1) ;
sno = t2 ;
if (strlen(t1) == 0)
return ;
if (sno < 1 || sno > 12)
{
valid = 0 ;
gotoxy(3,23) ;
cout <<" ";
gotoxy(3,23) ;
cout <<"\7ENTER CORRECTLY" ;
getch() ;
}
} while (!valid) ;
gotoxy(3,23) ;
if (!DELETE_FLIGHT(sno))
cout <<"\7Records not found. Press any key to continue..." ;
else
cout <<"\7Records deleted. Press any key to continue..." ;
getch() ;
}
void main(void)
{
textcolor(LIGHTBLUE+BLINK) ;
delay(2000);
cout<<"\n\n\t\t\a\aWELCOME TO COMPUTERISED AIRLINE RESERVATION SYS...";
getch();
PASSANGER p ;
TICKET ticket ;
RESERVE r ;
ticket.ADDITION() ;
char ch ;
while (1)
{
clrscr() ;
textcolor(BLACK) ;
textbackground(WHITE) ;
for (int i=7; i<=19; i++)
for (int j=20; j<=61; j++)
{
gotoxy(j,i) ;
cprintf(" ") ;
}
gotoxy(29,9) ;
cprintf("AIR TICKET RESERVATION") ;
gotoxy(29,10) ;
cprintf("~~~~~~~~~~~~~~~~~~~~~~") ;
gotoxy(30,11) ;
cprintf("1: RESERVATION") ;
gotoxy(30,12) ;
cprintf("2: CANCELLATION") ;
gotoxy(30,13) ;
cprintf("3: PASSENGER RECORDS ->") ;
gotoxy(30,14) ;
cprintf("4: ENQUIRY") ;
gotoxy(30,15) ;
cprintf("5: LIST OF PASSENGERS") ;
gotoxy(30,16) ;
cprintf("6: QUIT") ;
gotoxy(30,18) ;
cprintf("ENTER YOUR CHOICE ") ;
ch = getche() ;
textcolor(LIGHTGRAY) ;
textbackground(BLACK) ;
clrscr() ;
if (ch == 27 || ch == '6')
break ;
else
if (ch == '1')
r.RESERVATION() ;
if (ch == '2')
r.CANCELLATION() ;
if (ch == '4')
{
ticket.ENQUIRY() ;
gotoxy(2,23) ;
cout <<"Press any key to continue..." ;
getch() ;
}
else
if (ch == '5')
p.LIST() ;
else
if (ch == '3')
{
while (1)
{
clrscr() ;
textcolor(BLACK) ;
textbackground(WHITE) ;
for (int i=7; i<=19; i++)
for (int j=20; j<=61; j++)
{
gotoxy(j,i) ;
cprintf(" ") ;
}
gotoxy(29,10) ;
cprintf("EDIT PASSENGER RECORDS") ;
gotoxy(29,11) ;
cprintf("~~~~~~~~~~~~~~~~~~~~~~") ;
gotoxy(33,12) ;
cprintf("1: PASSANGER INFORMATION") ;
gotoxy(33,13) ;
cprintf("2: DELETE") ;
gotoxy(33,14) ;
cprintf("0: EXIT") ;
gotoxy(31,16) ;
cprintf("ENTER YOUR CHOICE ") ;
ch = getche() ;
textcolor(LIGHTGRAY) ;
textbackground(BLACK) ;
clrscr() ;
if (ch == 27 || ch == '0')
break ;
else
if (ch == '1')
r.DISPLAY_TICKET() ;
else
if (ch == '2')
r.DELETE_ALL() ;
}
}
}
}
References
Links
www.cs76.net
www.github.google.com
www.thinkdigit.com