The C++programming language was developed at AT&T Bell laboratories in the early igSo’s by Biarne Stroustrup. He found out C! la"#ing for simulating and de"ided to e$tend the language by adding features from his favourite language. SimtaS% was one of the earliest ob%e"toriented languages. Biarne Stroustrup "alled it C with "lasses! originally. The name C++ was "oined by 'i"# (as"itti where!++!is the C in"rement operator. )ver sin"e its birth* C++ evolved to "ope with problems en"ountered by users* and through dis"ussions at AT&T. The ma%or reasons for its su""ess is the support for ob%e"t oriented programming* whi"h is most near to real world situations. However* the maturation of the C++ language is attested by re"ent events, - The formation of an AS/ 0Ameri"an ational Standard /nstitute1 C++ "ommittee* and - The publi"ation of the Annotated C++ 'eferen"e (anual by )llis and Stroustrup. 2ne "an easily %udge the importan"e of C++ as given the following lines, 2b%e"toriented 2b%e"toriented te"hnology is regarded as the ultimate paradigm for the modeling of the information in the data of logi". The C++ is now shown to fulfill this goal!. This is a pro%e"t basedon train reservation. The program helps us to enter* display or alter the details of different trains. (oreover & most importantly the program helps us to reserve or "an"el a train ti"#et. The program also helps us to #now the present status of a reservedti"#et* i.e. whether the ti"#et is "onfirmedor not. /t in"ludes various fun"tion programs to do the above mentionedtas#s. 3ata file handling has been effe"tively usedin the program. This program uses the "on"ept of ob%e"toriented programming programming and data file handling handling.. The database is a "olle"tion of interrelated data to serve multiple appli"ations. That is database programs "reate files of information. So we see that files are wor#ed with most* inside the program. 3B(S The software re4uired for the management of data is "alled as 3B(S. /t has5 models - 'elation model - Hierar"hi"al model - etwor# model ')6AT/2A6 (23)6/t’s based on the "on"ept on relation. 'elation is the table that "onsists of rows and "olumns. The rows of the table are "alled tuple and the "olumns of the table are "alled attribute. umbers of rows in the table is "alled as "ardinality. umber of "olumns in the table is "alled as degree. H/)'A'CH/CA6 (23)6/n this type of model* we have multiple re"ords for ea"h re"ord. A parti"ular re"ordhas one parent re"ord. o "hid re"ord "an e$ist without parent re"ord. /n this* the re"ords are organi7ed in tree 0i#e stru"ture )T82'9 (23)6, /n this* the data is representedby "olle"tion of re"ords and relationship is represented by 0in# or asso"iation. CHA'ACT)'/ST/CS 2: 3B (S, ; - /t redu"es the redundan"y - 'edu"tion of data in in"onsisten"y - 3ata sharing - 3ata standardi7ation 3/::)')T 3/::)')T T<=)S 2: :/6)S, BAS)3 2 ACC)SS, - Se4uentialfil Se4uentialfile e - Serial file - 'andom 0dire"t a""ess1 file BAS)3 2 ST2'A>), - Te$t file - Binary :ile ??='2>'A( T'A/ ')S)'@AT/2 indude
#include #include #include #include #include #include #include class train { private : int trainno, nofafseat,nofasseat,nosseat,nofacseat,nofss nofafseat,nofasseat,nosseat,nofacseat,nofssseat; seat; char trainname[60],startingpoint[60],destination[60] trainname[60],startingpoint[60],destination[60];; public :
train( { trainno!0; nofafseat!0; nofasseat!0; nosseat!0; nofacseat!0; nofssseat!0; strcp"(trainname,$0; strcp"(startingpoint,$0; strcp"(destination,$0; % void input(; $$&o input the details void displa"(; $$&o displa" the details int returntr(; int returnaf(; int returnas(; int returnfs(;
int returnac(; int returnss(; %tr; int train::returntr( { return trainno; % int train::returnaf( { return nofafseat; % int train::returnas( { return nofasseat; % int train::returnfs( { return nosseat; % int train::returnac( { return nofacseat; %
int train::returnss( { return nofssseat; % '' void train::input( { clrscr(; goto"('0,'0; cout) )*+&* &-* &./+ +12* ; goto"(34,'0; cin55trainno; goto"('0,'; cout) )*+&* &-* +12* 78 .$9 8/& 9. *.&; goto"(34,'; cin55nofafseat; goto"('0,'<; cout) )*+&* &-* +12* 78 .$9 *97+= 9. *.&; goto"(34,'<; cin55nofasseat; goto"('0,'6; cout) )*+&* &-* +12* 78 8/& 9. **>* *.&; goto"(34,'6; cin55nosseat; goto"('0,'?; cout) )*+&* &-* +12* 78 .$9 9-./ 9. *.&; goto"(34,'?; cin55nofacseat; goto"('0,0; cout) )*+&* &-* +12* 78 *97+= 9. **>* *.&; goto"(34,0; cin55nofssseat; goto"('0,; cout) )*+&* &-* &./+ +.1*; goto"(34,; gets(trainname; goto"('0,<; cout))*+&* &-* &.&/+@ >7/+& ; goto"(34,<; gets(startingpoint; goto"('0,6; cout))*+&* &-* =*&/+.&/7+ ; goto"(34,6; gets(destination; void train::displa" ( { clrscr(; goto"('0,'0; cout))&./+ +12* ; goto"(<4,'0; cout)))train! name! ;! goto"(<4,';! puts(trainname;! goto"('0,'<;! cout))no! of! a! c! Arst! class! seats! goto"(<4,'<;! cout)))))))starting! point! goto"(<4,<;! puts(startingpoint;! goto"('0,6;! cout))destination! goto"(<4,6;! puts(destination;! goto"('0,?;! cout))press! an"! Be"! to! continue! getch(;! %! ticBets! {! int! resno,toaf,nofaf,toas,nofas,tofs,nos,toac,nofac,toss,nofss,age;! char!
status[<0],name[<0];! public:! ticBets(;! void! reservation(;! for! ticBet! reservation! cancellation(;! cancellation! ret(;! displa"(;! displa"! details! %ticB;! ticBets::ticBets(! resno!0; toaf!0; nofaf!0; toas!0; nofas!0; tofs!0; nos!0; toac!0; nofac!0; toss!0; nofss!0; age!0; strcp"(status,! 0;! strcp"(name,! ticBets::ret(! return! resno;! ticBets::displa"(! f!0; clrscr(;! ifstream! fn(ticBet'Cdat,ios::out;! fnCseeBg(0;! if(Dfn! cout))error! in! the! Ale! :! goto"('0,'0;! cout))enter! no! n;! cin!55n; Ehile(DfnCeof( { fnCread((charFGticB,siHeof(ticB; goto"('0,'0; if(n!!resno { clrscr(; f!'; goto"('0,'0; cout) )+.1* ; goto"(I0,'0 ; cout)))age! ;! goto"(I0,';! cout)))present! status! goto"(I0,'<;! cout)))reservation! number! goto"(I0,'6;! cout)))press! an"! Be"! to! continue! getch(;! %! if(f!!0 {! clrscr(;! goto"('0,'0;! cout))unrecoginiHed! reservation! no! DDD! Eanna! retr"! J("! n! char! a;! cin!55a; if(a!!"KKa!!L { clrscr(; goto M; % else { goto"('0,'; cout) )>* .+L N*L &7 97+&/+*; getch(; % % fnCclose(; % void ticBets::reservation( { clrscr(; goto"('0,'0; cout))**O.&/7+ ; goto"('0,'; cout))*+&* &-* &./+ +7: ; int tno,f!0; cin55tno; ofstream Ale; ifstream An(&rain'Cdat,ios::out; AnCseeBg(0; if(DAn { clrscr(; goto"('0,'0; cout) )*7 /+ &-* 8/* ; clrscr(; Ehile(D AnCeof( { AnCread((charFGtr,siHeof(tr; int H; H!trCreturntr(; if(tno!!H { f!'; nofaf!trCreturnaf(; nofas!trCreturnas(; nos!trCreturnfs(; nofac!trCreturnac(; nofss!trCreturnss(; % % if(f!!' { AleCopen(&icBet'Cdat,ios::app; : clrscr(; goto"('0,'0; cout))+.1*:; gets(name; goto"('0,'; cout)).@*:; cin55age; clrscr(; goto"('0,'0; cout) )**9& &-* 9 . P-/9- L7 P/ &7 &.O*; goto"('0,'; cout))'C.$9 8/& 9. ; goto"('0,'<; cout))C.$9 *97+= 9. ; goto"('0,'6; cout))IC8/& 9. **>* ; goto"('0,'?; cout))* ; goto"('0,; cout))*+&* L7 9-7/9* ; goto"(I0,; int c; cin55c; sEitch(c { case ': toafQQ; resno!rand(; if((nofafRtoaf50 { strcp"(status,conArmed; goto"('0,< ; cout) )&.&; goto"(I0,<; puts(status; goto"('0,6; cout))**O.&/7+ +7; goto"(I0,6; cout)))status;! goto"(I0,<;! puts(status;! goto"('0,6;! cout))reservation! no;! goto"(I0,6;! cout)0 { strcp"(status,conArmed; goto"('0,< ; cout) )&.&; goto"(I0,<; puts(status; goto"('0,6; cout))**O.&/7+ +7; goto"(I0,6; cout)))status;! goto"(I0,<;! puts(status;! goto"('0,6;! cout))reservation! no;! goto"(I0,6;! cout)0 { strcp"(status,conArmed; goto"('0,< ; cout) )&.&; goto"(I0,<; puts(status; goto"('0,6; cout))**O.&/7+ +7; goto"(I0,6; cout)))status;! goto"(I0,<;! puts(status;! goto"('0,6;! cout))reservation! no;! goto"(I0,6;! cout)0 { strcp"(status,conArmed; goto"('0,< ; cout) )&.&; goto"(I0,<; puts(status; goto"('0,6; cout))**O.&/7+ +7; goto"(I0,6; cout)))status;! goto"(I0,<;! puts(status;! goto"('0,6;! cout))reservation! no;! goto"(I0,6;! cout)0
{ strcp"(status,conArmed; goto"('0,< ; cout) )&.&; goto"(I0,<; puts(status; goto"('0,6; cout))**O.&/7+ +7; goto"(I0,6; cout)))status;! goto"(I0,<;! puts(status;! goto"('0,6;! ! cout))reservation! no;! goto"(I0,6;! cout)))do! "ou! Eish! to! continue! booBing! ticBets! ("! n! J! ;! goto"(34,I0;! char! n;! cin!55n; if(n!!S"SKKn!!SLS { goto ; % % % if(f!!0 { clrscr(; goto"('0,'0; cout) )*7 /+ &-* &./+ +12* *+&**= DDD; getch(; % AleCclose(; % void ticBets::cancellation( { clrscr(; ifstream An; AnCopen(&icBet'Cdat,ios::out; ofstream Ale; AleCopen(&emp'Cdat,ios::app; AnCseeBg(0; goto"('0,'0; cout))*+&* &-* **O.&/7+ +7 ; int r,f!0; cin55r; if(DAn cout) )*7 /+ &-* 8/* DDD; % Ehile(DAnCeof( { AnCread((charFGticB,siHeof(ticB; int H; H!ret(; if(HD!r { AleCErite((charFGticB,siHeof(ticB; % if(H!!r { f!'; % % AleCclose(; AnCclose(; remove(&icBet'Cdat; rename(&emp'Cdat,&icBet'Cdat; if(f!!0 { goto"('0,'; cout))+7 9- **O.&/7+ / 1.=* DDD >*.* *&L ; getch(; % else { goto"('0,'; cout))**O.&/7+ 9.+9**=; getch(; % % void main( { int ch,r!'000,T; clrscr(; goto"(II,; cout))P*971*; U: clrscr(; goto"(3,? ; cout))./P.L &/9N*& **O.&/7+; goto"(3,V; cout))!!!!!!!!!!!!!!!!!!!!!!!!!!; goto"(0,'3 ; cout))'C&./+ =*&./; goto"(0,'4; cout))C>=.&* &./+ =*&./ ; goto"(0,'V; cout))IC**O/+@ . &/9N*& ; goto"(0,'; cout)).L &-* >**+& &/9N*& &.& ; goto"(0,3; cout))6C*M/&; goto"(0,4; cout))*+&* L7 9-7/9*: ; cin55ch; char n; sEitch(ch { case ': { ifstream An(&rain'Cdat,ios::out; AnCseeBg(0; clrscr(; if(DAn { clrscr(; goto"('0,'0; cout) )*7 /+ &-* 8/* DDD; % else { clrscr(; Ehile(DAnCeof( { AnCread((charFGtr,siHeof(tr; trCdispla"(; % % AnCclose(; goto U; % case : clrscr(; goto"(0,'0; cout))*+&* &-* >.P7= ; cin55T; goto"(0,I0; cout) )9-*9N/+@ >*.* P./& ; getch(; ead more at: http:$$proTectsCicbseCcom$cppRI<6