You are on page 1of 94

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

A Project report n

!USING C""# S$%&itte' to(

KURUKS)*TRA UNI+*RSIT, KURUKS)*TRA


IN T)* PARTIAL FULFILL-*NT T)* F R*.UIR*-*NT F R

BAC)*L R F SCI*NC* !INF R-ATI N T*C)N L G,#


Se&ester +I S*SSI N !/012-/013#
Un'er t4e s$pervision o5(

-s6 S$r%4i A77arwal Lect$rer


8*PTT6 F IT

S$%&itte' %y(

An9it G$pta B6Sc -IT !Final#


Roll No6 ( 111:/2 Univ6 RollNo611/1//:0/;

8epart&ent o5 In5or&ation Tec4nolo7y


-UKAN8 LAL NATI NAL C LL*G* ,A-UNA NAGAR - 12:001
-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

C*RTIFICAT* FR SUP*R+IS R

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

-UKAN8 LAL NATI NALC LL*G* ,A-UNA NAGAR - 12:001


!NAAC A" GRA8*8#

<) - IT -A, C NC*RN

T4is is to certi5y t4at -s6 An9it G$pta o5 S/O Mr. Kishor Gupta of B.Sc.

Information Technology (Hons. !I Semester ,ear 4as co&plete' 4is


project s$ccess5$lly on ="#I$%#& "'S'"!#TIO( S&ST'M >$sin7 C"" $n'er &y s$pervision6 It is 5$rt4er certi5ie' t4at t4e project wor9 is can'i'ate?s own wor9 an' is not s$%&itte' to else w4ere 5or any ot4er p$rpose6 I wis4 4er s$ccess in 4i& 5$t$re6

-iss6S$r%4i A77arwal Lect$rer@ 8eptt6 5 I6T6 -6L6NColle7e ,a&$naNa7ar !)r6#

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

C*RTIFICAT* FR C LL*G*

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

-UKAN8 LAL NATI NALC LL*G* ,A-UNA NAGAR - 12:001


!NAAC A" GRA8*8#

<) - IT -A, C NC*RN

T4is is to certi5y t4at -s6 An9it G$pta is S/O Mr. Kishor Gupta of B.Sc.

Information Technology (Hons. !I Semester a %ona5i'e st$'ent o5 B6Sc6


!)on?s# IT Final ,ear o5 t4is colle7e6 S4e 4as co&plete' 4is project s$ccess5$lly on =RAILWAY RESERVATION SYSTEM =$sin7 C""6 <e wis4 4er s$ccess in 4i& 5$t$re6

8r6 !-r6# S4ailes4 Kapoor Principal -6L6N Colle7e ,a&$na Na7ar !)r6#

Pro56 G6K6Set4i Co-or'inator@ 8eptt6 5 I6T6 -6L6N Colle7e ,a&$na Na7ar !)r6#

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

ACKN <L*8G*-*NT

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

ACKN <L*8G*-*NT

T4is is ti&e to eAtent &y sincere 7ratit$'e to t4ose people w4o 'irectly or in'irectly 4elpe' &e in i&ple&entin7 t4is project %eyon' all eApectation6 I wo$l' li9e to convey &y 4eartily in'e%te'ness to Pro56 !) 8# B -s6 S$r%4i A77arwal !Lect$rer#@ 8eptt6 o5 In5or&ation Tec4nolo7y w4ose a%le 7$i'ance@ re7$lar co$nselin7@ 9een interest@ constant enco$ra7e&ent an' 4is will to 4elp $s6 I also li9e to convey &y sincere an' special t4an9s to 8r6 !-r6# S4ailes4 Kapoor@ Principal@ -UKAN8 LAL NATI NAL Colle7e@ ,a&$na Na7ar 5or provi'in7 &e s$c4 5acilities an' in5rastr$ct$re reC$ire' 5or co&pletion o5 t4is project6 I a& also 7rate5$l to &y Parents@ an' 5rien's w4o 7ave &e 5$ll s$pport an' t4eir precio$s ti&e to &e an' &y pro%le&@ 5ace' '$rin7 &y project wor96 G6K6Set4i

An9it G$pta
B6Sc6 - III !IT#

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

IN8*D

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

IN8*D
S6N6 16 /6 26 36 :6 ;6 Partic$lars C*RTIFICAT* FR - SUP*R+IS R ACKN <L*8G*-*NT INTR 8UCTI N T T PIC BE*CTI+* F PR E*CT S,ST*- 8*FINATI N S,ST*- 8*SIGN FF FF FF G6 H6 LISTI NG %6 I6 106 116 1/6 126 INPUT 8*SIGNING UTPUT 8*SIGNING 8ATAFL < 8IAGRA-S F S FT<AR* 8*+*L P-*NT Pa7e No6

S,ST*- 8 CU-*NTATI N AN8 FL < C)ART a6 INPUT UTPUTS C NCLUSI N A8+ANTAG*S F PR E*CT 8ISA8+ANTAG*S F PR E*CT FURT)*R SC P* F T)* PR E*CT R*F*R*NC*S

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

INTR 8UCTI N T T PIC

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

INTR 8UCTI N T

T PIC

T4is is a project $sin7 w4ic4 we can reserve t4e seats o5 a rail w4ic4 is to %e 7one 5or a visit6 T4is wo$l' 4elp in airlines to reserve any seat as we can reserve a seat in railway 5or a jo$rney as well as in t4is we can reserve o$r seat in plane jo$rney6 T4is is $se' to &aintain t4e 'ata o5 t4e passen7er its co'e an' also t4e tic9et n$&%er 5or t4e rail so t4at we can con5ir& t4e reservation wit4in ti&e6 F$nctions o5 t4is reservation syste& can %e s$&&e' $p in t4e 5ollowin7 points(16 It can %e $se' to reserve t4e seat 5or a passen7er6 /6 It can %e $se' to C$ery t4e 'ata or t4e reservation i5 we want to C$ery 5or any anot4er passen7er i5 t4e person want to c4ec9 5or any C$ery t4en t4e person can easily c4ec9 5or it %y enterin7 t4e na&e an' co'e o5 rail 6 26 T4ere is also possi%ility o5 cancellation o5 seat 6 36 It is $se' 5or viewin7 t4e reservation 'etail o5 a sin7le c$sto&er6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

INTR 8UCTI N T PR E*CT

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

INTR 8UCTI N T

T)* PR E*CT

Railway Reservation Syste& are very $se5$l 5or airline area6 T4is wo$l' 4elp t4e a$t4orities an' ot4er concerne' people to wor9 5ast6 T4is wo$l' also 4elp to &aintain t4e 'ata o5 t4e person to %e visitin7 t4e airlines an' also t4is wo$l' %e 4elp to provi'e t4e in5or&ation to t4e ot4er concerne' area 5or t4e reservation@ cancellation an' &o'i5ication6 In Reservation syste& all wor9 is 'one &an$ally6 A en' $seJcler9 can only reserve t4e tic9et an' t4is only can %e con5ir& 5ro& 4i&6 By co&p$teriKtion syste& t4is can %e centralise' an' as t4is can %e $se' 5or reservation as well as t4e w4ole 'ata can %e trans&itte' to ot4er a$t4orities 5or c4ec9in7 t4e ot4er 5or&alitie6 Beca$se w4ile travellin7 t4ro$74 airlines it is necessary to 7et t4e passport 4ence t4ere is entry o5 passport n$&%er t4en t4e place co'e is 7iven %y w4ic4 t4e person 4ave to %e travellin7@ 4ence t4e 'ata can %e &aintain %eca$se t4e co'e will 'isplay t4e in5or&ation a%o$t t4e persons to travel an' ot4er 'ata can %e &aintaine'6 All t4ese wor9 is 'one o$t &an$ally t4ese 'ays6 A 4$7e C$antity o5 5iles is &aintaine' to save every c$sto&ers recor'6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

16 T4e reports are not pro'$ce' in ti&e an' t4e railway a$t4orities 4as little $se o5 t4at in5or&ation6 /6 Lot o5 e55orts an' paper wor9 is involve'6 26 T4ere are c4an7es o5 inacc$racy i5 t4e reservation is cancelle'6 36 So&e in5or&ation is not sent in any 5iAe' 5or&at@ so t4e 4i74er &ana7e&ent 4ave to ta9e a lon7er ti&e to $n'erstan' it an' are $na%le to ta9e ti&ely action6 :6 So&e ti&e in5or&ation is also &isplace' or p$t in 'i55erent places an' w4en reports are 5or it %eco&es very 'i55ic$lt to 5in' t4ese reports6 ;6 So&eti&es t4ere is '$plications o5 wor9 an' e55orts6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

Beca$se o5 4avin7 so &any li&itations in t4e eAistin7 syste& t4ere %eco&es a nee' o5 intro'$cin7 t4e co&p$terise' syste&6 <4ic4 is calle' as propose' syste&6 T4is propose' syste& will 4elp in co&p$terisation o5 t4e eAistin7 syste& So t4at t4e li&itations o5 eAistin7 syste& can %e recti5ie'6 In t4e propose' syste& it is propose' to 'evelop a so5tware w4ic4 is 4elp5$l in reservin7 t4e tic9et 5or a train to %e 'eparte' in 5$t$re6 By t4is co&p$terisation syste& t4e process will %eco&e less ti&e cons$&in7@ acc$rate an' centralise' syste& 6 In t4e propose' syste& t4ere is prepare' t4e sc4e'$les o5 Reservin7 t4e tic9et@ secon' option will %e o5 &o'i5ication o5 t4at reserve' tic9et L to c4an7e t4e na&e@ 'ate@ plane co'e@ 5ro&@ to@ or any c4an7e in a&o$nt o5 t4at 5li74t will %e 'one $sin7 t4is option6 A5ter t4is option t4ere is cancellation o5 t4e tic9et@ i5 a person 4ave to cancel t4e tic9et t4en t4is so5tware 4ave to cancel t4e tic9et6 A5ter t4is report will %e 7enerate w4ic4 will s4ows all t4e recor' 5or t4e latest an' t4e recor's will %e 7enerate' t4ro$74 t4is option6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

BE*CTI+* F T)* PR E*CT

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

BE*CTI+*

F T)* PR E*CT

M To provi'e an e55icient an' relia%le &aintenance syste&@ w4ic4 is a'apta%le to c4an7e an' responsive to nee's 5or in5or&ation6 M To provi'e acc$rate an' relia%le in5or&ation %etween cler9 o55ice@ store an' war's in ti&e an' in a'apta%le 5or&6 M To s$pply in5or&ation to $ser in ti&e an' in t4e reC$ire' 5or&ats6 M To re'$ce t4e papers wor9 in t4e &aintenance o5 t4e 'i55erent 'epart&ents o5 t4e resta$rant6
M To 'evelop Jprint t4e %ill o5 partic$lar c$sto&er6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

S,ST*- 8*FINATI N

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

S,ST*- 8*FINATI N
<e want to &a9e a co&p$teriKe' syste& t4at will allow $s to access any in5or&ation we 4ave store' earlier@ &a9e c4an7es in it an' appen' new 'ata6 T4e $ser reC$ests are entertaine' i&&e'iately 'epen'in7 $pon t4e availa%ility o5 t4e in5or&ation in t4e 'ata%ase6 T4is syste& also e&powers t4e $ser to retrieve@ $p'ate an' store t4e in5or&ation on speci5ie' criteria6 A co&plete speci5ication o5 syste& reC$ire&ent is essential 5or a so5tware 'evelop&ent e55ort6 Syste& analysis is con'$cte' wit4 t4e 5ollowin7 o%jectives in &in'( M I'enti5y t4e nee's6 M *val$ate t4e syste& 5easi%ility6 M Per5or& econo&ic an' tec4nical analysis M Allocate 5$nctions to 4ar'ware@ so5tware@ people@ 'ata%ase an' ot4er syste& ele&ents6 M *sta%lis4 cost an' sc4e'$le constraints6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

S,ST*- 8*SIGN

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

S,ST*- 8*SIGN
Syste& 'esi7n is t4e 5o$n'ation 5or all pro7ra& i&ple&entation6 It is a 'etail concentration or sol$tion o5 4ow to approac4 to creation o5 new syste&6 Syste& 'esi7n involves6 Syste& 'ei7n is a sol$tion@ a =4ow to> approac4 to t4e creation o5 a new syste&6 T4is p4ase is co&pose' o5 several steps6 It provi'es t4e $n'erstan'in7 an' proce'$ral 'etails necessary 5or i&ple&entin7 t4e syste& 6'esi7n 7oes t4ro$74 lo7ical an' p4ysical sta7es o5 t4e 'evelop&ent6 Lo7ical 'esi7n reviews t4e present p4ysical syste&L prepares inp$t an' o$tp$t speci5icationsL &a9es e'it@ sec$rity@ an' control speci5icationsL 'etails t4e i&ple&entation planL an' prepares a lo7ical 'esi7n wal9t4ro$746 P4ysical 'esi7n &aps o$t t4e 'etails o5 t4e p4ysical syste&@ plans t4e syste& i&ple&entation@ 'evices a test an' i&ple&entation plan@ an' speci5ies any new 4ar'ware an' so5tware6 Syste& 'esi7n 5or t4e propose' syste& is co&pose' o5 several steps6 1# /# 2# Inp$t $tp$t File 8esi7n

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

INPUT 8*SIGN 5ten t4e collection o5 inp$t 'ata is t4e &ost eApensive part o5 t4e syste&@ in ter&s o5 %ot4 t4e eC$ip&ent?s $se' an' t4e n$&%er o5 people involve'6 I5 'ata 7oin7 in to t4e syste& is incorrect@ t4en processin7 an' o$tp$t will &a7ni5y its errors6 T4$s@ t4e 'esi7ner 4as a n$&%er o5 clear o%jectives in inp$t 'esi7n6 A s$ccess5$l 'esi7nin7 o5 inp$ts is nee'e'@ so t4at it can 5$l5ill all t4e 5$t$re reC$ire&ents6 T4e 5ollowin7 are t4e 'esi7n o5 inp$t6 Train co'e ( *nter Na&e a''ress ( )o$se No6 ( Colony Post City ( ( ( ( (

Pin Co'e No6

*nter a7e !,ears6-ont4s# ( *nter seA 7ro$p !- J F# 'ate '' && yy ( ( ( (

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

5or inp$t t4ese varia%les t4e 5ollowin7 5$nctions are $se' (a''ressNinp!# T4is 5$nction is $se' to 7et t4e inp$t o5 t4e a''ress 5or t4e person in t4is t4en na&e@ city@ state an' pin no6 o5 t4e person 6 pN'etNinp!# T4is 5$nction is $se' to 7et t4e inp$t o5 t4e 'estination o5 t4e person 5ro& w4ic4 'estination to w4ic4 'estination t4e persons 4ave to 7o6 In it t4e 'estination are provi'e' an' t4e $ser 4ave to c4oose t4e co'e 5or t4e partic$lar 'estination to %e visite' voi' 'atNinp!# T4is 5$nction is $se' to enter t4e 'ate 5or t4e reservation t4e 'ate is entere' in t4e 5or& o5 &&@ ''@ yy@6 -& stan's 5or &ont4@ '' stan's 5or 'ate an' t4e yy stan's 5or t4e year6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

UTPUT 8*SIGN T4e 5$nctional processin7 o5 t4e syste& t4e process states or t4e reC$ire' in5or&ation is represente' in a well 5or&atte' way accor'in7 to $sers reC$ire&ents B t4at %$ilt co&es o5 o$tp$t 'esi7n6 As we r$n o$r pro7ra& a screen will s4own on t4e &onitor6 It will as9 5or press any 9ey to start t4e calc$lation6 As t4e $ser press enter 9ey@ t4e calc$lator 5or&at is s4own6 T4e %$tton on t4e calc$lator will %e presse' $sin7 &o$se %$tton@ %eca$se o5 t4e GUI provi'e' %y &e6 T4is will s4ow t4e o$tp$t o5 t4e reserve' seat 5or t4e last passen7er reserve'6 <e can 7et t4is o$tp$t %y $sin7 t4e C$ery 5ro t4e &ain &en$6 T4e o$tp$t 'esi7n will %e as 5ollows (-

OOOOOOOOOOOOOOOOOOOO<elco&e to .U*R, OOOOOOOOOOOOOOOOO

PIN8IAN RAIL<A,

R*S*R+ATI N *NTRI*S OOOOOOOOOOOOOOOOOOOOO

-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

Train Co'e

P*RS NAL 8*TAILS Na&e ( A'ress is( SeA 7ro$p !-JF# ( 5ro& 8AT* ( via(OO to ( !,ears6-ont4s# ( //

( 10 Q 10 Q /00Ha

OOOOOOOOOOO Press any 9ey to contin$e

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

FIL* 8*SIGN <4en t4e 'ata is 5e$'e' into t4e co&p$ter t4ere is always nee' 5or t4e stora7e o5 'ata6 T4ese val$es 5or t4e 'eclare' varia%les are store' in t4e 5ile w4ic4 t4en %e accesse' or restore' to syste& 5or a''ition@ C$ery an' cancellation o5 t4e reservation tic9ets an' etc6 For preparation o5 &y project I 4ave $se' t4e 5iles na&e' ( l'&as6'at New&as6'at Fro& t4ese 5iles t4e 'ata will %e retrieve' an' store' to r$n t4e project properly

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

)AR8<AR* B S FT<AR* R*.UIR*-*NTS


)ar'ware

)ar'ware re5ers to t4e p4ysical pieces o5 t4e syste&( t4e syste& $nit@ &onitor@ an' 9ey%oar'6 <e pro%a%ly also 4ave a &o$se an' printer an' &ay%e a 5ew %ells an'

w4istles6 Co&p$ter tec4nolo7y 4as evolve' at an a&aKe' rate '$rin7 past 5ew 'eca'es6 To'ay a co&p$ter cannot only co&p$te@ store in5or&ation %$t at t4e sa&e ti&e it provi'es a variety o5 so5tware 5or entertain&ent p$rpose6 T4is project 4as its 4ar'ware B so5tware reC$ire&ents as 5ollows(

Syste&
T4e syste& $nit 4o$ses t4e 4eart o5 yo$r co&p$ter6 T4is Unit is w4ere t4e &icroprocessor c4ip@ 'is9 'rives@ an' t4e power s$pply are locate'6

-icroprocessor
T4e &icroprocessor provi'es t4e %rains o5 yo$r co&p$ter@ an a&aKin7

con7lo&eration o5 electronic &icro &iniat$riKe' into a sin7le silicon c4ip6 T4e &icroprocessor eAec$tes t4e pro7ra& co&&an's t4at &a9e $p a wor' processor@ a

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

CA8JCA- syste&@ a solitaire Ga&e an' t4e &any ot4er pro7ra&s t4at r$n on yo$r co&p$ter6 ,o$ s4o$l' %e a%le to see t4e c4ip on yo$r Syste& %oar'6

Coprocessor
,o$r syste& also &i74t 4ave a &at4 coprocessor 4an'les &at4 %etter t4an t4e &ain processor 'oes@ si7ni5icantly spee'in7 $p pro7ra&s t4at &$st 'o a lot o5 4eavy calc$latin76

-e&ory
,o$r &e&ory co&ponents store t4e pro7ra&s an' 'ata C$rrently in $se6 T4ese co&ponents provi'e s4ort-ter&@ 4i74-spee' stora7e closely lin9e' to t4e &icroprocessor 5or 5ast retrieval6

Key%oar'
,o$r 9ey%oar' wor9s &$c4 li9e a typewriter@ wit4 so&e i&portant 'i55erences6 In a''ition to t4e re7$lar typin7 area@ it 4as 5$nction 9eys@ a 9eypa'@ an' so&e special P$rpose 9eys6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

)AR8<AR* R*.UIR*-*NTS

T4e co&p$ter as a &ac4ine B all ot4er eC$ip&ent associate' wit4 it constit$tes 4ar'ware B t4e 4ar'ware reC$ire&ents 5or t4is project is as 5ollows( -

P-1 processor an' a%ove 1; -B RAH00 R ;30 resol$tions 103 9eys 9ey%oar' Color &onitor

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

S FT<AR* R*.UIR*-*NTS

T4e instr$ctions t4at tell it w4at to 'o are calle' so5tware6 T4e so5tware reC$ire&ents 5or t4is project are(

peratin7 Syste& <IN8 <S IDJNT@ DP@ DP/ C"" co&piler

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

+*R+I*<
INTR 8UCTI N(

F SC""?

SC? see&s to %e a stran7e na&e 5or a pro7ra&&in7 lan7$a7e6 B$t t4is stran7e so$n'in7 lan7$a7e is one o5 t4e &ost pop$lar co&p$ter

lan7$a7e to'ay6 SC? was an o55sprin7 o5 t4e SBasic Co&%ine' Pro7ra&&in7 Lan7$a7e? !BCPL# calls B@ 'evelope' in t4e 1I;0?s at Ca&%ri'7e $niversity6

SB? lan7$a7e was &o'i5ie'

%y

8ennis Ritc4ie

an' was i&ple&ente' at

%ell la%oratories in 1IG/6 T4e new lan7$a7e was na&e' SC""?6 Since it was 'evelope' alon7 wit4 t4e UNID operatin7 syste&@ it is stron7ly

associate' wit4 UNID6 T4is operatin7 syste&@ w4ic4 was also 'evelope' at Bell la%oratories@ was co'e' al&ost entirely in C""6

For &any years@

SC? was $se' &ainly in aca'e&ic environ&ents@ SC""? co&pilers 5or co&&ercial $se wi'esprea'

%$t event$ally wit4 t4e release o5

an' t4e increasin7 pop$larity o5 UNID@ it %e7an to 7ain s$pport a&on7 co&p$ter pro5essionals6 To'ay

SC""? is r$nnin7 $n'er a

n$&%er o5 operatin7 syste&s incl$'in7 -S-8 S6 Since -S-8 S is a

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

'o&inant operatin7 syste& 5or &icroco&p$ters6 It is nat$ral t4at SC""? 4as %e7an to in5l$ence t4e &icroco&p$ter co&&$nity at lar7e6

I-P RTANC*

F SC""?

T4e increasin7 pop$larity o5 SC""? is pro%a%ly '$e to its &any 'esira%le C$alities6 It is a ro%$st lan7$a7e w4ose ric4 set o5 %$ilt in 5$nctions an' operators can %e $se' to write any co&pleA pro7ra&6 T4e SC""? co&piler co&%ines t4e capa%ilities o5 an asse&%ly lan7$a7e wit4 t4e 5eat$res o5 a 4i74 level lan7$a7e an' t4ere5ore it is well s$ite' 5or writin7 %ot4

syste& so5tware an' %$siness pac9a7es6 In5ect &any o5 t4e SC""? co&pilers availa%le in t4e &ar9et are written in SC""?6

Pro%le&s written in SC""? are e55icient an' 5ast6 T4is is '$e to its variety o5 'ata types an' power5$l operators6 It is &any ti&es 5aster t4an BASIC6 For eAa&ple@ a pro7ra& to incre&ent a varia%le 1:000 ta9es a%o$t 5ro& 0 to

one secon' Js in SC""? w4ile it ta9es &ore t4an :0

secon's in an interpreter BASIC6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

T4ere are only 2/ 9eywor's an' its stren7t4 lies in its in -%$ilt

5$nctions6

Several stan'ar' 5$nctions are availa%le w4ic4 can %e $se' 5or 'evelopin7 pro7ra&s6

SC""? is 4i74ly porta%le6 T4is &eans t4at one co&p$ter can %e r$n on anot4er

SC""? pro7ra&s written 5or wit4 little or no &o'i5ication6

Pro%a%ility is i&portant i5 we plan to $se a new co&p$ter wit4 a 'i55erent operatin7 syste&6

SC""? lan7$a7e is well s$ite' 5or str$ct$re' pro7ra&&in7@ t4$s reC$irin7 t4e $ser to t4in9 o5 a pro%le& in ter&s o5 5$nction &o'$les or %loc9s6 A proper collection o5 t4ese &o'$les wo$l' &a9e a co&plete pro7ra&6 T4is &o'$lar str$ct$re &a9e pro7ra& 'e%$77in7@ testin7 an' &aintena-nce easier6

Anot4er i&portant 5eat$re o5 SC""? is its a%ility to eAtent itsel56 A SC""? pro7ra& is %asically a collection o5 5$nctions t4at are s$pporte' %y t4e SC""? li%rary6 <e can contin$o$s- ly a'' o$r 5$nctions to t4e SC""? li%rary6 <it4 t4e availa%il-ity o5 a lar7e n$&%er o5 5$nctions @ t4e pro7ra&&in7 tas9 %eco&es si&pler6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

<4ere an' w4y is C"" $se' SC""? was initially $se' 5or syste&s pro7ra&&in76 A syste&s pro7ra& 5or&s portions o5 t4e operatin7 syste& o5 its s$pporte' $tilities6 peratin7 syste&s interprets@ e'itors@ asse&%ly pro7ra&s are $s$ally calle' syste&s pro7ra&s6

T4e UNID operatin7 syste& was 'evelope' $sin7

SC""?6 To'ay@ &any

pro7ra&&ers to pro7ra& all 9in' o5 tas9s %eca$se o5 its porta%ility an' e55iciency are $sin7 C6 t4ere are SC""? co&pilers availa%le 5or al&ost all co&p$ters6 A co'e written in SC""? on a partic$lar &ac4ine can %e

co&pile' an' r$n on anot4er &ac4ine %y &a9in7 a 5ew or no c4an7es6 Also SC""? co&piler very 5ast o%ject co'e6

In

a''ition to

t4e a%ove@

SC""? o55ers t4e

spee' o5 an asse&%ly

lan7$a7e@ %$t 5ew o5 t4e restrictions o5 a str$ct$re' lan7$a7e6 Pro7ra&&in7 can create an' &aintain a $niC$e li%rary o5 5$nctions@ w4ic4 can %e

$se' %y &any 'i55erent pro7ra&s6 T4$s lar7e projects can %e &ana7e' easily wit4 &ini&al '$plication o5 e55ort6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

C"" PR GRA--ING STRUCTUR*


An i&portant aspect o5 SC""? is t4at it 4as a &ini&al n$&%er o5 9eywor's@ 2/ too precise6 T4ese 9eywor's co&%ine t4e 5or&al SC""? syntaA 5ro& t4e SC""? pro7ra&&in7 lan7$a7e6 -any 4owever a''e' SC""? co&pilers 4ave@

several 9eywor's to eAploit t4e &e&ory or7aniKation o5

certain preprocessors6

So&e r$les@ w4ic4 4ol' 5or all pro7ra&s written in SC""?@ are as 5ollows( All 9eywor's are lowercase'6 C is case sensitive@ 'o w4ile is 'i55erent to 8 <)IL*6 Keywor's can not %e $se' 5or any ot4er p$rpose6 I6e6 t4ey cannot %e $se' as varia%le or 5$nctions na&e6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

S,ST*- ANAL,SIS Feasi%ility Analysis An initial investi7ation c$l&inates in a proposal t4at 'eter&ines w4et4er an alternative syste& is 5easi%le6 T4e 5easi%ility analysis 'escri%es an' eval$ates Telep4one %ill an' Telep4one enC$iry syste& an' provi'es 5or t4e selection o5 t4e %est syste& t4at &eets syste& per5or&ance reC$ire&ents6 To 'o a 5easi%ility st$'y@ we nee' to consi'er t4e econo&ic@ tec4nical@ an' %e4avioral 5actor in syste& 'evelop&ent6 First a project tea& is 5or&e'6 T4e tea& 'evelops syste& 5lowc4arts t4at i'enti5y t4e c4aracteristics o5 Telep4one %ill an' Telep4one enC$iry syste&@ eval$ate t4e per5or&ance o5 eac4 syste&@ wei74 syste& per5or&ance an' cost 'ata@ an' select t4e %est Telep4one %ill an' Telep4one enC$iry syste& 5or t4e jo%6 T4ree 9ey consi'erations are involve' in t4e 5easi%ility analysis( econo&ic@ tec4nical@ an' %e4avioral *cono&ic Feasi%ility *cono&ic analysis is t4e &ost 5reC$ently $se' &et4o' 5or eval$atin7 t4e e55ectiveness o5 a Telep4one %ill an' Telep4one enC$iry syste&6 -ore co&&only 9nown as costJ%ene5it analysis@ t4e proce'$re is to 'eter&ine t4e %ene5its an' savin7s t4at are eApecte' 5ro& a Telep4one %ill an' Telep4one

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

enC$iry syste& an' co&pare t4e& wit4 costs6 Telep4one %ill an' Telep4one enC$iry syste& %ene5its o$twei74 costs@ so t4e syste& is &a'e to 'esi7n an' i&ple&ent t4e syste&6 So@ we 'on?t nee' 5$rt4er j$sti5ication or alterations in t4e propose' syste&6 Tec4nical Feasi%ility Tec4nical Feasi%ility centers aro$n' t4e eAistin7 co&p$ter syste& !4ar'ware@ so5tware@ etc6# an' to w4at eAtent it can s$pport t4e propose' syste&6 In o$r case i5 Telep4one %ill an' Telep4one enC$iry syste& is r$nnin7 on a co&p$ter t4en it $ses 10T o5 t4e CPU capacity6 So we can r$n &$ltiple instances o5 Telep4one %ill an' Telep4one enC$iry syste& on a sin7le co&p$ter6 T4is syste& 'oesn?t reC$ire a''itional 4ar'ware6 I5 t4e %$'7et is serio$s constraint@ t4en t4is project j$'7e' 5easi%le6 CostJBene5it analysis In 'evelopin7 cost esti&ates 5or Telep4one %ill an' Telep4one enC$iry syste&@ we consi'er 5ollowin7 cost ele&ents( )ar'ware costs relate to t4e act$al p$rc4ase or lease o5 t4e co&p$ter an' perip4erals6 T4e 4ar'ware speci5ication reC$ire' 5or t4is project is very co&&on an' it costs c4eap an' easily a55or'a%le %y 8epart&ent o5 Teleco&&$nication6 8eter&inin7 t4e act$al cost o5 4ar'ware is 7enerally

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

&ore 'i55ic$lt w4en t4e syste& is s4are' %y vario$s $sers t4an 5or a 'e'icate' stan'-alone syste&6 In so&e cases@ t4e %est way to control 5or t4is cost is to treat it as an operatin7 cost6 Personnel costs incl$'e salaries an' %ene5its as well as pay 5or t4ose involve' in 'evelopin7 t4e syste&6 Costs inc$rre' '$rin7 t4e 'evelop&ent o5 a syste& are one-ti&e costs an' are la%ele' 'evelop&ental costs6 In t4is Telep4one %ill an' Telep4one enC$iry syste& only one person wor9e' 5or one &ont4@ so t4e personnel cost is &ini&$& 5or 'evelop w4ole syste&6 Facility costs are eApenses inc$rre' in t4e preparation o5 t4e p4ysical site w4ere t4e application or t4e co&p$ter will %e in operation6 T4is is treate' as one-ti&e costs an' is incorporate' into t4e overall cost esti&ate o5 t4e Telep4one %ill an' Telep4one enC$iry syste&6 peratin7 costs incl$'e all costs associate' wit4 t4e 'ay-to-'ay operation o5 t4e syste&6 T4e operation o5 t4is Telep4one %ill an' Telep4one enC$iry syste& is very easy to $n'erstan' an' easy to operate6 Beca$se@ operatin7 cost 'epen's $pon t4e co&p$ter ti&e@ sta55 ti&e an' vol$&e o5 t4e o$tp$t pro'$ce'@ so we 'esi7n t4e syste& in s$c4 a way so t4at t4e sta55 can easily operate t4e syste& an' e55iciency o5 t4e operation will increase6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

Pro7ra&&in7 Lan7$a7e Front *n' T$r%oC"" is $se' as t4e pro7ra&&in7 lan7$a7e 5or t4e i&ple&entation o5 t4e project6 Bac9 *n' <e $se 8ata%ase 5ile !8AT 5ile# to store o$r 'ata o5 all persons w4ic4 4ave telep4one connection6 T4is project is %ase' on lan7$a7e C"" an' all in5or&ation is store' in 8AT 5ile6 T4is 5ile is create' %y $sin7 =5open! #>6 So o$r pro7ra&&in7 is totally C"" %ase' pro7ra&&in76

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

8ata Flow 8ia7ra&

Rail B Reservation 8ata 5or train Reservation


Reser vation 8etail

Railway Arrival B 8epart$re 5ile Train Bac9$p@ Fair Save Pro5ile

Select *ntries

8etail

Train 8etails

User ReC$e st

Pic9 Appl Na&e

Pic9 s$% &en$

Applic

Rea'

P$t Appl

8esire' 8ata

s$%&e

pe User@ S$%&en$@ application n 5ile S$% &en$ 5ile

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

8ATA 8ICTI NAR,


In 'ata 'ictionary t4ere are vario$s attri%$tesJvaria%les an' 5$nctionsJ&et4o's are $se'6 T4ese are 7iven %elow(-

Attri%$te c4ar t9tnoU1:VL c4ar stco'eU1:VL

c4ar tna&eU1:VL c4ar 5ro&U1:VL c4ar toU1:VL c4ar 'N'ateU1:VL c4ar rclassU1:VL int rateL WtL c4ar tco'eU1:VL c4ar tna&eU1:VL c4ar 5ro&U1:VL c4ar toU1:VL c4ar '1N'ateU1:VL c4ar '/N'ateU1:VL
-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

c4ar '2N'ateU1:VL c4ar '3N'ateU1:VL c4ar st1U1:VL c4ar st/U1:VL c4ar st2U1:VL c4ar st3U1:VL c4ar st:U1:VL int 5cNtot@5cN%9@5cNav@scNtot@scN%9@scNav@acNtot@acN%9@acNavL WsL

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

C 8ING

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

Q incl$'e Xiostrea&64F Q incl$'e X5strea&64F Q incl$'e Xstrin764F Q incl$'e Xst'li%64F Q incl$'e Xst'io64F Q incl$'e Xctype64F Q incl$'e X'os64F Q incl$'e Xconio64F Q incl$'e Xprocess64F Q incl$'e X7rap4ics64F voi' $serNscreen!#L class TICK*T Y private(

C 8ING

voi' A88NR*C R8!c4arU10V@c4arU1:V@c4arU1:V@int@int#L p$%lic( voi' A88ITI N!voi'#L voi' *N.UIR,!voi'#L voi' BK*N.UIR,!voi'#L c4ar RTrainN !int#L protecte'( c4ar 5ltnoU10V@5ro&U1:V@toU1:VL int eco5air@eAe5airL WL
-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

JJT)IS CLASS C NTR LS ALL T)* FUNCTI NS R*LAT*8 T PASS*NG*RS class PASS*NG*R Y p$%lic( voi' A88NR*C R8!int@int@c4arU/;V@c4arU2;V@int@c4ar@c4ar#L voi' 8*L*T*NTICK*T!int#L int 8*L*T*NTrain!int#L voi' LIST!voi'#L int LASTNTICK*TN !voi'#L int S*ATS!int#L int F UN8!int#L c4ar RNA-*!int#L voi' PASSNINF !#L voi' - 8IF,!#L protecte'( c4ar Class@ na&eU/;V@a''ressU2;V@seAL int slno@a7e@tic9etnoL WL JJT)IS IS T)* 8*RI+*8 CLASS <)IC) C NTR LS ALL T)* FUNCTI NS JJR*LAT*8 T R*S*R+ATI N@ CANC*LLATI N@*TC6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

class R*S*R+* ( p$%lic TICK*T@p$%lic PASS*NG*R Y p$%lic( voi' R*S*R+ATI N!voi'#L voi' BKR*S*R+ATI N!voi'#L voi' CANC*LLATI N!voi'#L voi' 8ISPLA,NTICK*T!voi'#L voi' 8*L*T*NALL!voi'#L WL JJFUNCTI N T A88 GI+*N 8ATA IN T)* TICK*T FIL*!TICK*T68AT#

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

voi' TICK*T (( A88NR*C R8!c4ar tN5ltnoU10V@c4ar tN5ro&U1:V@c4ar tNtoU1:V@int tNeco5air@int tNeAe5air# Y 5strea& 5ileL 5ile6open!ZTICK*T68ATZ@ios((app#L strcpy!5ltno@tN5ltno#L strcpy!5ro&@tN5ro&#L strcpy!to@tNto#L eco5air [ tNeco5airL eAe5air [ tNeAe5airL 5ile6write!!c4arR#t4is@siKeo5!TICK*T##L 5ile6close!#L W JJFUNCTI N T R*TURN Train N 6 F R T)* GI+*N S6N c4ar RTICK*T (( TrainN !int sno# Y 5strea& 5ileL 5ile6open!ZTICK*T68ATZ@ios((in#L int co$nt [ 1L w4ile!5ile6rea'!!c4arR# t4is@siKeo5!TICK*T### Y i5 !sno [[ co$nt# %rea9L co$nt""L W 5ile6close!#L
-LN ,NR

ret$rn 5ltnW

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

JJFUNCTI N T GI+* 8ATA T A88 R*C R8S IN T)* TICK*T FIL* voi' TICK*T (( A88ITI N!voi'# Y 5strea& 5ileL 5ile6open!ZTICK*T68ATZ@ios((in#L i5 !\5ile65ail!# # ret$rnL 5ile6close!#L A88NR*C R8!ZKL1G;Z@Z8*L)IZ@Z-U-BAIZ@1:00@1G00#L A88NR*C R8!ZKL1GGZ@Z-U-BAIZ@Z8*L)IZ@1:00@1G00#L A88NR*C R8!ZKL1:;Z@Z8*L)IZ@ZCALCUTTAZ@1G00@1I00#L A88NR*C R8!ZKL1:GZ@ZCALCUTTAZ@Z8*L)IZ@1G00@1I00#L A88NR*C R8!ZKL1;;Z@Z8*L)IZ@Z-A8RASZ@/100@/200#L A88NR*C R8!ZKL1;GZ@Z-A8RASZ@Z8*L)IZ@/100@/200#L A88NR*C R8!ZKL1G;Z@Z-U-BAIZ@ZCALCUTTAZ@1I00@/100#L A88NR*C R8!ZKL1GGZ@ZCALCUTTAZ@Z-U-BAIZ@1I00@/100#L A88NR*C R8!ZKL1H;Z@Z-U-BAIZ@Z-A8RASZ@1H00@/000#L A88NR*C R8!ZKL1HGZ@Z-A8RASZ@Z-U-BAIZ@1H00@/000#L A88NR*C R8!ZKL1I;Z@ZCALCUTTAZ@Z-A8RASZ@1;00@1H00#L A88NR*C R8!ZKL1IGZ@Z-A8RASZ@ZCALCUTTAZ@1;00@1H00#L W JJFUNCTI N T 8ISPLA, LIST F Trains

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

voi' TICK*T (( *N.UIR,!voi'# Y clrscr!#L 5strea& 5ileL 5ile6open!ZTICK*T68ATZ@ios((in#L 7otoAy!20@2#L co$tXXZLIST 7otoAy!1H@:#L co$tXXZSno6 Train N 6 FR int row [ G@sno [ 1L w4ile!5ile6rea'!!c4arR#t4is@ siKeo5!TICK*T### Y 7otoAy!1H@row#L co$tXXsnoL 7otoAy!/2@row#L co$tXX5ltnoL 7otoAy!23@row#L co$tXX5ro&L 7otoAy!33@row#L co$tXXtoL 7otoAy!:2@row#L co$tXXeco5airL 7otoAy!;2@row#L co$tXXeAe5airL row""L sno""L W 5ile6close!#L W
-LN ,NR BSC IT FINAL

F T)* TrainSZL

*C 6FAIR *D*6FAIRZL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

voi' TICK*T (( BK*N.UIR,!voi'# Y clrscr!#L 5strea& 5ileL 5ile6open!ZTICK*T68ATZ@ios((in#L 7otoAy!20@2#L co$tXXZLIST 7otoAy!1H@:#L co$tXXZSno6 Train N 6 FR int row [ G@sno [ 1L w4ile!5ile6 Rea'!!c4arR#t4is@ siKe o5!TICK*T### Y 7otoAy!1H@row#L co$tXXsnoL 7otoAy!/2@row#L co$tXX5ltnoL 7otoAy!23@row#L co$tXX5ro&L 7otoAy!33@row#L co$tXXtoL 7otoAy!:2@row#L co$tXXeco5air R /L 7otoAy!;2@row#L co$tXXeAe5air R /L row""L sno""L W 5ile6 Close!#L
BSC IT FINAL

F T)* TrainsZL

*C 6FAIR *D*6FAIRZL

-LN ,NR

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

JJFUNCTI N T R*S*R+* TICK*T F R T)* PASS*NG*RS voi' R*S*R+* (( R*S*R+ATI N!voi'# Y clrscr!#L *N.UIR,!#L c4ar t1U1:V@pclass@pna&eU/;V@pa''ressU2;V@pseA@p5ltnoU10VL int t/@vali'@pa7e@tno@snoL PASS*NG*R pL tno [ p6LASTNTICK*TN !# " 1L 'o Y vali' [ 1L 7otoAy!2@/2#L clreol!#L co$tXXZPR*SS X*NT*RF T *DITZL 7otoAy!2@/0#L clreol!#L co$tXXZ*NT*R T)* SN 6 F T)* Train ( ZL 7ets!t1#L t/ [ atoi!t1#L sno [ t/L i5!strlen!t1# [[ 0# ret$rnL
-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

i5!sno X 1 ]] sno F 1/# Y vali' [ 0L 7otoAy!2@/2#L clreol!#L co$tXXZ*NT*R C RR*CTL,ZL 7etc4!#L W W w4ile!\vali'#L int i[1L 5strea& 5ileL 5ile6open!ZTICK*T68ATZ@ios((in#L w4ile!5ile6rea'!!c4arR#t4is@ siKeo5!TICK*T### Y i5!sno [[ i# %rea9L i""L W 5ile6close!#L strcpy!p5ltno@5ltno#L i5!p6S*ATS!sno#F[/:0# Y 7otoAy!:@/1#L co$tXXZ^GSorry\ S*ATS AR* N T A+AILABL*ZL 7etc4!#L ret$rnL W 7otoAy!2@/2#L clreol!#L co$tXXZ*[*C N -IC@D[*D*CUTI+* or PR*SS X*NT*RF T *DITZL 'o
-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

7otoAy!2@/1#L clreol!#L co$tXXZB, <)IC) CLASS , U < UL8 LIK* T TRA+*L ( ZL pclass [ 7etc4e!#L pclass [ to$pper!pclass#L i5!pclass [[ 12# ret$rnL W w4ile!pclass \[_*_ BB pclass \[_D_#L clrscr!#L 7otoAy!G/@2#L co$tXXZX0F-*DITZL 7otoAy!23@/#L co$tXXZR*S*R+ATI NZL 7otoAy!:@:#L co$tXXZNA-* 7otoAy!:@;#L co$tXXZA88R*SS ( ZL 7otoAy!:@G#L co$tXXZS*D -JF ( ZL 7otoAy!:@H#L ( ZL

co$tXXZAG* 'o
-LN ,NR

( ZL

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

Y vali' [ 1L 7otoAy!:@/:#L clreol!#L co$tXXZ*NT*R T)* NA-* 7otoAy!1:@:#L clreol!#L 7ets!pna&e#L i5!pna&eU0V [[ _0_# ret$rnL i5!strlen!pna&e# X 1 ]] strlen!pna&e# F /:# Y vali' [ 0L F T)* PASS*NG*RZL

7otoAy!:@/:#L clreol!#L co$tXXZ^G*NT*R C RR*CTL, YRANG* ( 1 T 7etc4!#L W W w4ile!\vali'#L /:WZL

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

'o

vali' [ 1L 7otoAy!:@/:#L clreol!#L co$tXXZ*NT*R T)* A88R*SS F T)* PASS*NG*RZL 7otoAy!1:@;#L clreol!#L 7ets!pa''ress#L i5!pa''ressU0V [[ _0_# ret$rnL i5!strlen!pa''ress# X 1 ]] strlen!pa''ress# F 2:# Y vali' [ 0L 7otoAy!:@/:#L clreol!#L co$tXXZ^G*NT*R C RR*CTL, YRANG* ( 1 T 2:WZL 7etc4!#L W W

w4ile!\vali'#L

-LN ,NR

BSC IT FINAL

Railway reservation

'o

Y 7otoAy!:@/:#L clreol!#L co$tXXZ*NT*R T)* S*D F T)* PASS*NG*RZL 7otoAy!1:@G#L clreol!#L pseA [ 7etc4e!#L pseA [ to$pper!pseA#L i5!pseA [[ _0_# ret$rnL W w4ile!pseA \[_-_ BB pseA \[_F_ #L 'o Y vali' [ 1L 7otoAy!:@/:#L clreol!#L co$tXXZ*NT*R T)* AG* F T)* PASS*NG*RZL 7otoAy!1:@H#L clreol!#L 7ets!t1#L

t/ [ atoi!t1#L pa7e [ t/L i5!t1U0V [[ _0_# ret$rnL i5!pa7e X 1 ]] pa7e F 100# Y vali' [ 0L 7otoAy!:@/:#L clreol!#L co$tXXZ^G*NT*R C RR*CTL, ZL 7etc4!#L W W 6 w4ile!\vali'#L
-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

clrscr!#L 7otoAy!11@3#L co$tXXZRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRZL 7otoAy!11@/1#L co$tXXZRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRZL 7otoAy!22@;#L co$tXXZTICK*T N 6 ( ZXXtnoL 7otoAy!1G@I#L co$tXX5ro&XXZ T ZXXtoL 7otoAy!3:@I#L co$tXXZTrain N 6 ( ZXXp5ltnoL 7otoAy!/0@11#L co$tXXZPASS*NG*R NA-* ( ZXXpna&eL 7otoAy!/0@12#L co$tXXZA88R*SS ( ZXXpa''ressL 7otoAy!/0@1:#L co$tXXZS*D ( ZXXpseAL 7otoAy!/0@1G#L co$tXXZAG* ( ZXXpa7eL 7otoAy!3:@1I#L i5!pclass [[ _*_# co$tXXZT TAL FAIR ( ZXXeco5airL else co$tXXZT TAL FAIR ( ZXXeAe5airL p6A88NR*C R8!tno@sno@pna&e@pa''ress@pa7e@pseA@pclass#L 7etc4!#L

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

JJ FUNCTI N T A88 T)* GI+*N 8ATA IN T)* PASS*NG*R_S FIL* voi' PASS*NG*R (( A88NR*C R8 !int tno@int sno@c4ar pna&eU/;V@c4ar pa''ressU2;V@int pa7e@c4ar pseA@c4ar pclass# Y 5strea& 5ileL 5ile6open!ZPASS68ATZ@ios((app#L tic9etno [ tnoL slno [ snoL strcpy!na&e@pna&e#L strcpy!a''ress@pa''ress#L a7e [ pa7eL seA [ pseAL Class [ pclassL 5ile6write!!c4arR#t4is@siKeo5!PASS*NG*R##L 5ile6close!#L W

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

voi' PASS*NG*R (( - 8IF,!# Y int tcnoL c4ar t1U1:V@pclass@pna&eU/;V@pa''ressU2;V@pseA@p5ltnoU10VL int t/@vali'@pa7e@tno@snoL

PASSNINF !#L co$tXXZ^n*NT*R T)* TICK*T NU-B*R F T)* PASS*NG*RZL cinFFtcnoL 5strea& 5ileL 5ile6open!ZPASS68ATZ@ios((in]ios((o$t#L int &[0L int lL 5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R##L

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

w4ile!\5ile6eo5!## Y &""L i5!tcno[[tic9etno# Y l[!&-1#RsiKeo5!PASS*NG*R#L co$tXXlL 7etc4!#L clrscr!#L 7otoAy!G/@2#L co$tXXZX0F-*DITZL 7otoAy!23@/#L co$tXXZR*S*R+ATI NZL 7otoAy!:@:#L co$tXXZNA-* 7otoAy!:@;#L co$tXXZA88R*SS ( ZL 7otoAy!:@G#L co$tXXZS*D -JF ( ZL 7otoAy!:@H#L co$tXXZAG* ( ZL ( ZL

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

7otoAy!:@/:#L clreol!#L co$tXXZ*NT*R T)* NA-* F T)* PASS*NG*RZL 7otoAy!1:@:#L clreol!#L 7ets!pna&e#L 7otoAy!:@/:#L clreol!#L co$tXXZ*NT*R T)* A88R*SS F T)* PASS*NG*RZL 7otoAy!1:@;#L clreol!#L 7ets!pa''ress#L 7otoAy!:@/:#L clreol!#L co$tXXZ*NT*R T)* S*D F T)* PASS*NG*RZL 7otoAy!1:@G#L clreol!#L pseA [ 7etc4e!#L pseA [ to$pper!pseA#L 7otoAy!:@/:#L clreol!#L co$tXXZ*NT*R T)* AG* F T)* PASS*NG*RZL

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

7otoAy!1:@H#L clreol!#L 7ets!t1#L t/ [ atoi!t1#L pa7e [ t/L co$tXXZCLASS(*!*C N -IC# pclass[7etc4e!#L i5!strlen!pa''ress#\[0# strcpy!a''ress@pa''ress#L i5!strlen!pna&e#\[0# strcpy!na&e@pna&e#L i5!strlen!t1#\[0# a7e[pa7eL i5!pseA\[12# seA[pseAL i5!pclass\[12# Class[pclassL 5ile6see9p!l#L 5ile6write!!c4arR#t4is@siKeo5!PASS*NG*R##L 5ile6close!#L ret$rnL W else R D!*D*CUTI+*#ZL

5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R##L W W
-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

voi' PASS*NG*R (( PASSNINF !# Y 5strea& 5ileL 5ile6open!ZPASS68ATZ@ios((in#L

co$tXXZ co$tXXZ 7otoAy!/@3#L co$tXXZT6N 6ZL 7otoAy!11@3#L co$tXXZS6N 6ZL 7otoAy!/:@3#L co$tXXZNA-*ZL 7otoAy!3H@3#L co$tXXZA88R*SSZL 7otoAy!;;@3#L co$tXXZAG*ZL 7otoAy!G0@3#L co$tXXZS*DZL 7otoAy!G3@3#L co$tXXZCLASSZL 7otoAy!1@:#L

PASS*NG*RS INF R-ATI N^nZL RRRRRRRRRRRRRRRRRRRRRRRRRR^nZL

co$tXXZRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRZL int tno@sno@pa7eL c4ar pna&eU/;V@pa''ressU2;V@pseA@pclass@p5ltnoU10VL int i[;L


-LN ,NR BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

w4ile!5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R### Y tno[tic9etnoL sno[slnoL strcpy!pna&e@na&e#L strcpy!pa''ress@a''ress#L pa7e [ a7eL pseA [ seAL pclass [ ClassL 7otoAy!/@i#L co$tXXtnoL 7otoAy!11@i#L co$tXXsnoL 7otoAy!/0@i#L co$tXXpna&eL 7otoAy!3:@i#L co$tXXpa''ressL 7otoAy!;G@i#L co$tXXpa7eL 7otoAy!G1@i#L co$tXXpseAL 7otoAy!GG@i#L co$tXXpclassL i""L W 5ile6close!#L
BSC IT FINAL

-LN ,NR

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

JJT)IS FUNCTI N R*TURNS T)* LAST TICK*T N 6 IN T)* PASS*NG*R FIL* int PASS*NG*R ((LASTNTICK*TN !voi'# Y 5strea& 5ileL 5ile6open!ZPASS68ATZ@ios((in#L int co$nt [ 0L w4ile!5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R### co$nt [ tic9etnoL 5ile6close!#L W ret$rn co$ntL

JJT)IS FUNCTI N R*TURNS T TAL N 6 F S*ATS IN T)* PASS*NG*R FIL* int PASS*NG*R (( S*ATS!int sno# Y 5strea& 5ileL 5ile6open!ZPASS68ATZ@ios((in#L int co$nt [ 0L w4ile!5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R### Y i5!sno [[ slno# co$nt""L W 5ile6close!#L W ret$rn co$ntL
BSC IT FINAL

-LN ,NR

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

JJT)IS FUNCTI N R*TURNS 0 IF T)* TICK*T N 6 IS N T F UN8 IN T)* JJPASS*NG*R FIL* int PASS*NG*R (( F UN8!int tno# Y 5strea& 5ileL 5ile6open!ZPASS68ATZ@ios((in#L int 5o$n' [ 0L w4ile!5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R### Y i5!tno [[ tic9etno# Y 5o$n' [ 1L

%rea9L W W 5ile6close!#L W ret$rn 5o$n'L

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

clreol!#L co$tXXZPR*SS X*NT*RF T 7otoAy!2@/0#L clreol!#L co$tXXZ*NT*R SN 6 F T)* Train <) S* 8*TAILS , U <ANTZL 7ets!t1#L t/ [ atoi!t1#L sno [ t/L i5!strlen!t1# [[ 0# ret$rnL i5!sno X 1 ]] sno F 1/# Y vali' [ 0L 7otoAy!2@/2#L clreol!#L co$tXXZ^G*NT*R C RR*CTL,ZL 7etc4!#L W w4ile!\vali'#L *DITZL

clrscr!#L int row [ H@5o$n' [ 0@5la7 [ 0L c4ar c4L 7otoAy!2@3#L co$tXXZTrain N 6----F ZXXtic9et6TrainN !sno#L 7otoAy!/H@/#L co$tXXZRRLIST 7otoAy!:@;#L co$tXXZTICK*T N 6 NA-* 7otoAy!3@G#L co$tXXZRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRZL 5strea& 5ileL 5ile6open!ZPASS68ATZ@ios((in#L 5ile6see97!0@ios((%e7#L w4ile!5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R###
-LN ,NR BSC IT FINAL

F PASS*NG*RSRRZL

CLASS ZL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

i5!sno [[ slno# Y 5la7 [ 0L

'elay!/0#L 5o$n' [ 1L 7otoAy!:@row#L co$tXXtic9etnoL 7otoAy!1G@row#L co$tXXna&eL 7otoAy!3I@row#L i5!Class [[ _D_# co$tXXZ*D*CUTI+*ZL else co$tXXZ*C N -ICZL i5!row [[ /1# Y 5la7 [ 1L row [ GL 7otoAy!:@/2#L co$tXXZPR*SS AN, K*, T C NTINU* R PR*SS X*SCFZL

c4 [ 7etc4!#L i5!c4 [[ /G# %rea9L clrscr!#L 7otoAy!2/@2#L co$tXXZLIST F PASS*NG*RSZL 7otoAy!/@:#L co$tXXZTICK*T N 6 NA-* W else
-LN ,NR

CLASS ZL

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

row""L W W i5!\5o$n'# Y 7otoAy!:@10#L co$tXXZ^GR*C R8S N T F UN8ZL W i5!\5la7# Y 7otoAy!:@/2#L co$tXXZPR*SS AN, K*, T C NTINU*6666ZL 7etc4!#L W 5ile6close!#L W v

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R##L i5!5ile6eo5!# # %rea9L i5!tno \[ tic9etno# te&p6write!!c4arR#t4is@siKeo5!PASS*NG*R##L W

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

Y te&p6rea'!!c4arR#t4is@siKeo5!PASS*NG*R##L i5!te&p6eo5!# # %rea9L 5ile6write!!c4arR#t4is@siKeo5!PASS*NG*R##L W 5ile6close!#L te&p6close!#L W

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

JJT)IS FUNCTI N 8*L*T*S PASS*NG*R R*C R8S F R T)* GI+*N Train N 6 int PASS*NG*R (( 8*L*T*NTrain!int sno# Y 5strea& 5ileL 5ile6open!ZPASS68ATZ@ios((in#L 5strea& te&pL te&p6open!Zte&p6'atZ@ios((o$t#L 5ile6see97!0@ios((%e7#L int 5o$n' [ 0L w4ile!\5ile6eo5!# # Y 5ile6rea'!!c4arR#t4is@siKeo5!PASS*NG*R##L i5!5ile6eo5!# # %rea9L i5!sno \[slno# te&p6write!!c4arR#t4is@siKeo5!PASS*NG*R##L else 5o$n' [ 1L W

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

5ile6close!#L te&p6close!#L 5ile6open!ZPASS68ATZ@ios((o$t#L te&p6open!Zte&p6'atZ@ios((in#L te&p6see97!0@ios((%e7#L w4ile!\te&p6eo5!# # Y te&p6rea'!!c4arR#t4is@siKeo5!PASS*NG*R##L i5!te&p6eo5!# # %rea9L 5ile6write!!c4arR#t4is@siKeo5!PASS*NG*R##L W 5ile6close!#L te&p6close!#L ret$rn 5o$n'L W

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

JJT)IS FUNCTI N CANC*LS PASS*NG*R_S TICK*T voi' R*S*R+* ((CANC*LLATI N!voi'# Y clrscr!#L c4ar t1U10V@c4L int t/@tno@vali'L 'o Y vali' [ 1L 7otoAy!2@/2#L clreol!#L co$tXXZPR*SS X*NT*RF T 7otoAy!2@/0#L clreol!#L co$tXXZ*NT*R TICK*TN 6 7ets!t1#L t/ [ atoi!t1#L tno [ t/L i5!t1U0V [[ _0_# ret$rnL F PASS*NG*R T CANC*L T)* TICK*TZL S** LIST R0T *DIT ZL

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

i5!strlen!t1# [[ 0# Y vali' [ 0L LIST!#L clrscr!#L W i5!\F UN8!tno# BB vali'# Y vali' [ 0L 7otoAy!2@/2#L clreol!#L co$tXXZ^GR*C R8 N T F UN8ZL 7etc4!#L W W w4ile!\vali'#L

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

W setcolor!13#L setteAtstyle!/@0@:#L o$tteAtAy!130@110@ZZ#L o$tteAtAy!130@1G3@Z Z#L 7otoAy!20@1/#L 7ets!$na&e#L i5 !strc&p!$na&e@ZZ#[[0# o$tteAtAy!/30@1G3@ZZ#L else Y o$tteAtAy!/30@1G3@ZPasswor'JNa&e Not KZ#L eAit!0#L W 7etc4!#L close7rap4!#L W

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

UTPUTS

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

C NCLUSI N

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

C NCLUSI N

I 'evelope' t4is project in s$c4 a way t4at it will %e $ser 5rien'ly so5tware to 4an'le t4e calc$lations6 T4is project $se' t4e n$&%er option to operate t4e ot4er co&&an's6 I 4ope $ser will 5in' no 'i55ic$lty w4ile operatin7 t4is so5tware@ as t4ere will %e no co&plications $ser j$st 4as to press t4e appropriate n$&%er to per5or& t4e operation6 )ope $ser will learn 5ro& t4is project as &$c4 I 4ave6 T4is project is a learnin7 eAperience 5or &e6 By wor9in7 on t4is project I will a%le to

'evelop &any s9ills an' 9nowle'7e a%o$t playin7 wit4 7rap4ics 5$nctions an' &any ot4er 5$nctions $se' in C""6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

A8+ANTAG*S F PR E*CT

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

A8+ANTAG*S F PR E*CT
By co&pt$erisation o5 t4ese syste& t4ere will %e t4e 5ollowin7 a'vanta7es o5 t4e propose' syste&6

16 /6 26

It is easy to reserve t4e tic9et 5or any jo$rney6 <it4 t4e propose' syste& paper wor9 re'$ces6 <it4 t4e new syste& it will %eco&e easy to cancel as it was very ti&e cons$&in7 process to cancel t4e reserve' tic9et6

36

T4e syste& &a9es t4e process easy to prepare t4e report 5or all t4e recor's we entere' so it %eco&e easy to searc4 5or any recor'6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

8ISA8+ANTAG*S F PR E*CT

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

8ISA8+ANTAG*S

F PR E*CT

B$t =not4in7 is per5ect in t4is worl'>6 T4is project also 4ave certain ass$&ptions an' li&itations@ w4ic4 are as 5ollows6

16 8$e to s4orta7e o5 ti&e@ i 4ave s9ippe' t4e ot4er i&portant ite&s or varai%le $se' at t4e ti&e o5 act$al reservation o5 Railway tic9et6 /6 T4is project also s$55ers 5ro& t4e li&itation o5 less 'oc$&entation6 -ore c4ec9s can %e incl$'e' on eac4 wron7 inp$t@ %$t '$e to s4orta7e o5 ti&e i can?t 7ive attention to eac4 aspect6 26 ,o$ 7et t4e wron7 res$lts i5 yo$ 5ee' t4e wron7 inp$t6t4e syste& s4ows &essa7e 5or t4e invali' inp$t6 36 <4enever syste& is wor9in7 an' power is switc4e' o55@ 'ata can %e lost6 :6 I5 &ore t4an t4e speci5ie' ran7e any res$lt 7ives t4e answer t4an t4e &essa7e 5or o$t o5 ran7e can %e 'isplaye'6 ;6 T4e &ain li&itation o5 t4is project is t4at it 'oes not s4ows all t4e 'ata%ase w4ic4 we &aintain 5or t4e stora7e o5 reservation o5 tic9et t4is only s4ows t4e c$rrent o5 t4e last &o'i5ie' or last reserve' 'ata6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

FURT)*R SC P* F PR E*CT

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

FURT)*R SC P*

F PR E*CT

,o$ can save 5or a lon7 ti&e as &any recor's as yo$ can an' t4ere is no c4ance o5 losin76 A5ter alon7 ti&e i5 yo$ want to see t4en t4ere are no pro%le&s to co&p$ter syste&6 ,o$ can see t4e recor's at any ti&e accor'in7 to 4is reC$ire&ent6 M Syste& 'on?t 7et %ore'@ t4ere5ore yo$ can see t4e recor' as &any ti&es as yo$ can6 Up'atin7 can %e easily 'one a5ter a lon7 perio' o5 ti&e6 <e can eApan' t4is project accor'in7 to t4e reC$ire&ents o5 'epart&ent6 T4e so5tware can %e en4ance' so t4at t4e reports

can %e 7enerate' 'ate wise6 M <e can incl$'e a &o'$le t4at tells $s a%o$t t4e n$&%er o5 seats availa%le6 M *n4ance&ent can %e &a'e so t4at t4e in5or&ation a%o$t w4et4er t4e seat is con5ir&e' or is in waitin7 can %e o%taine'6 M -ore c4ec9s can %e incl$'e' on eac4 wron7 inp$t6 M To 7enerate reports a%o$t 4ow &any reservations an' cancellations are &a'e in a 'ay6 M *n4ance&ent can %e &a'e so t4at reservation can %e 'one t4ro$74 e-tic9et6

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

R*F*R*NC*

-LN ,NR

BSC IT FINAL

Railway reservation

BSC - IT FINAL

ANKIT GUPTA

R*F*R*NC*S
Boo9s S6No6 1 / 2 3 : ; AUT) R Plasto9 B Gor'en @ Roy A6 La5ore @Ro%ert Kanet9ar @ ,as4want Kanet9ar @,as4want Sc4il't @)er%ert )$%%ar' @ Eo4n R6 NA-* FB K R*F6 PAG*6N 3:-3G 2:-3G 3;-:: 2/-2: 30-3: /2-/H

Co&p$ter Grap4ics C"" Co&plete Re5erence Let Us C"" Grap4ics Un'er C T4e Co&plete re5erence C"" S4a$& $tline 5 Pro7ra&&in 7 C""

*6 Bala7$r$swa&y

%ject oriente' Pro7ra&&in7 in C""

2H-30

<e%sites ( www6cpl$spl$s6co& www6cpro7ra&&in76co& www6learncpp6co& www6co'esor$ce6netJco'eso$rceNcpppro7ra&&in764t&l

-LN ,NR

BSC IT FINAL

You might also like