railway reservation system

railway reservation system -...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 Code : #include<conio.h> #include<stdio.h> #include<graphics.h> #include<stdlib.h> #include<dos.h> #include<string.h> #include<math.h> /***************Global Variable Declarations****************/ union REGS i,o int xmax,ymax int gdriver = DETECT, gmode, errorcode,x,y int count=0,no_pass=0 FILE *ptr1 char d[8][3]={{"S1"},{"S2"},{"S3"},{"S4"},{"S5"},{"S6"},{"S7"},{"S8"}} char x1[2] /****************************Global Structures declared**********/ struct travel { char tno[5] //char doj[10] int d1,m1,y1 char from[4] char to[4] char passen[6][20] char sex[6][2] char age[6][3] int seat_no[6] char coano[3] //float pnr long int pnr float bill }passenger struct { //float pnr long int pnr }pass struct { int seat_no char coano[3] char status[1] }berth struct {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 char tno[5] char tname[20] }train /***********************User Defined Functions***********/ void firstscreen() void mainmenu() void reserv() void clear() void setgraph() void clearline() void drawbox() void cancel() void enquiry() void color(int,int,int) void printtic(struct travel) /*****************Main Function*****************************/ void main() { int i FILE *ptr,*tr /***********loop for writing train nos***************/ if((tr=fopen("tra.dat","r"))==NULL) { tr=fopen("tra.dat","w") strcpy(train.tno,"3143") strcpy(train.tname,"Darjeeling Mail") strcpy(train.tno,"3147") strcpy(train.tname,"Uttarbanga Exp") fclose(tr) } /************loop for writing train berth nos*********/ if((ptr=fopen("berths3.dat","r"))==NULL) { ptr=fopen("berths3.dat","wb") strcpy(berth.coano,d[0]) strcpy(berth.status,"V") for(i=1 i<=73 { if(i>72) { count++ strcpy(berth.coano,d[count]) i=1 } if(count==8)
Background image of page 2
Sheet1 Page 3 break berth.seat_no=i } } fclose(ptr) if((ptr=fopen("berths7.dat","r"))==NULL) { ptr=fopen("berths7.dat","wb") strcpy(berth.coano,d[0]) strcpy(berth.status,"V") for(i=1 i<=73 { if(i>72) { count++ strcpy(berth.coano,d[count]) i=1 } if(count==8) break berth.seat_no=i } } fclose(ptr) textcolor(WHITE) textbackground(BLACK) clrscr() firstscreen() mainmenu() reserv() cancel() getch() } void firstscreen() { int r,c for(r=4 r<=20 { gotoxy(20,r) printf("*") gotoxy(60,r) printf("*") } for(c=20 c<60 { gotoxy(c,4) printf("*")
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 4 gotoxy(c,20) printf("*") } gotoxy(36,6) textattr(LIGHTRED) cprintf("PROJECT") gotoxy(39,8) textcolor(BLUE) cprintf("ON") gotoxy(32,10) textcolor(BROWN) cprintf("Railway Reservation") gotoxy(25,13) textcolor(YELLOW) putch(1) textcolor(CYAN) cprintf(" DEVELOPERS : ") cprintf("Dinesh Chachan") gotoxy(40,14) cprintf("Ashutosh Kumar") gotoxy(40,15) cprintf("Deepshikha Deb") gotoxy(25,17) textcolor(YELLOW) putch(2) textcolor(CYAN) cprintf(" GUIDE : ") textcolor(CYAN) cprintf("Udit Chakraborty") gotoxy(28,23) textcolor(MAGENTA + BLINK) cprintf("Press a key to continue") getch() } void mainmenu() { char choice setgraph() settextjustify(CENTER_TEXT, CENTER_TEXT)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 322

railway reservation system -...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online