Add to Favorites    Make Home Page 51249 Online  
 Language Categories  
 Our Services  

Home » C Home » File Operations Home » Time Scheduler

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Time Scheduler
Author Atiq Anwar
Author Email anwaratiq_786 [at] sifymail.com
Description "THE SCHEDULER"
THE PROJECT IS MADE FOR THE EXECUTION OF TIME TABLES. A COMMON PROBLEM ARISES THAT A COMMON ROOM OR A COMMON TEACHER IS SHARED BY TWO OR MORE
CLASSES. THIS PROJECT IS TO SOLVE PROBLEMS LIKE THIS.
Category C » File Operations
Hits 425341
Code Select and Copy the Code
/**************************************************************************** ***************************************************************************** "THE SCHEDULER" THE PROJECT IS MADE FOR THE EXECUTION OF TIME TABLES. A COMMON PROBLEM ARISES THAT A COMMON ROOM OR A COMMON TEACHER IS SHARED BY TWO OR MORE CLASSES. THIS PROJECT IS TO SOLVE PROBLEMS LIKE THIS. ***************************************************************************** ****************************************************************************/ /***************************************************************************/ /*******************************HEADER FILES********************************/ /***************************************************************************/ #include<graphics.h> #include<stdio.h> #include<conio.h> #include<string.h> /*******************************LETS START*********************************/ /***************************THE WELCOME SCREEN*****************************/ void first() { int gd=DETECT,gm; initgraph(&gd,&gm,"c:\\tc\\bgi"); setcolor(GREEN); settextstyle(4,0,8); outtextxy(200,50,"TIME"); setcolor(YELLOW); settextstyle(4,0,8); outtextxy(100,190,"SCHEDULER"); settextstyle(1,0,1); setcolor(RED); outtextxy(480,350,"Made By:"); setcolor(BLUE); outtextxy(480,370,"Atiq Anwar"); getch(); restorecrtmode(); } /******************************WORK BEGINS********************************/ /**********************FUNCTION FOR THE 'MAIN MENU'***********************/ char file() { int gdriver=DETECT, gmod; char i; initgraph(&gdriver,&gmod,"c:\\tc\\bgi"); setcolor(RED); rectangle(170,85,430,385); rectangle(175,90, 425,380); setcolor(GREEN); settextstyle(7,0,4); outtextxy(130,45,"TIME TABLE MANAGER"); settextstyle(7,0,3); setcolor(YELLOW); outtextxy(260,95,"MENU"); settextstyle(0,0,0); setcolor(MAGENTA); outtextxy(200,145,"1>>ENTER TEACHER."); outtextxy(200,170,"2>>ENTER ROOM."); outtextxy(200,195,"3>>REMOVE TEACHER."); outtextxy(200,220,"4>>REMOVE ROOM."); outtextxy(200,245,"5>>VIEW TEACHER."); outtextxy(200,270,"6>>VIEW ROOM."); outtextxy(200,295,"7>>CREATE TIME TABLE."); outtextxy(200,320,"8>>VIEW TIME TABLE."); outtextxy(200,343,"0>>EXIT."); setcolor(GREEN+BLINK); outtextxy(200,360,"ENTER YOUR CHOICE:"); i=getche(); restorecrtmode(); return (i); } /********************************OUTLINES********************************/ /************************THE COMMON DISPLAY FRAME************************/ void frame() { int x,y,i,j; clrscr(); x=0; y=0; for(i=0;i<78;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",205); x++; } x=0; y=25; for(i=0;i<80;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",205); x++; } x=1; y=1; for(i=0;i<25;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",186); y++; } x=79; y=1; for(i=0;i<25;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",186); y++; } gotoxy(1,1); cprintf("%c",201); gotoxy(1,25); cprintf("%c",200); gotoxy(79,1); cprintf("%c",187); gotoxy(79,25); cprintf("%c",188); } /*****************************TEACHER COMES*******************************/ /**********************OUTPUT FOR TEACHER'S DATAS**************************/ void teacher() { int i; struct teacher { char nam[25],sub[15],room[15]; }t; FILE *fp; fp=fopen("teacher.txt","r"); if(fp==NULL) { gotoxy(30,12); textcolor(RED+BLINK); cprintf("Cannot Open File!!"); exit(); } frame(); textcolor(GREEN); gotoxy(5,2); cprintf("Name"); gotoxy(35,2); cprintf("Subject"); gotoxy(68,2); cprintf("Choice"); for(i=3;i<=77;i++) { textcolor(YELLOW); gotoxy(i,3); cprintf("-"); } i=4; while(fscanf(fp,"%s %s %s ",t.nam,t.sub,t.room)!=EOF) { gotoxy(5,i); printf("%s",t.nam); gotoxy(35,i); printf("%s",t.sub); gotoxy(68,i); printf("%s",t.room); i++; if(i > 20) { clrscr(); frame(); textcolor(GREEN); gotoxy(5,2); cprintf("Name"); gotoxy(35,2); cprintf("Subject"); gotoxy(68,2); cprintf("Choice"); for(i=3;i<=77;i++) { textcolor(YELLOW); gotoxy(i,3); cprintf("-"); } i=4; } } fclose(fp); } /*******************************ROOM OPENS********************************/ /************************OUTPUT FOR ROOM'S DATAS***************************/ void room() { struct room { int cap; char rt[20],rn[15]; }r; int i; FILE *fp; clrscr(); fp=fopen("room.txt","r"); if(fp==NULL) { gotoxy(30,12); textcolor(RED+BLINK); cprintf("Cannot Open File!!"); exit(); } frame(); textcolor(GREEN); gotoxy(5,2); cprintf("Room"); gotoxy(35,2); cprintf("Room Code"); gotoxy(68,2); cprintf("Capacity"); for(i=3;i<=77;i++) { textcolor(YELLOW); gotoxy(i,3); cprintf("-"); } i=4; while(fscanf(fp,"%s %s %d",r.rt,r.rn,&r.cap)!=EOF) { gotoxy(5,i); printf("%s",r.rt); gotoxy(35,i); printf("%s",r.rn); gotoxy(68,i); printf("%d",r.cap); i++; if(i > 20) { getch(); clrscr(); frame(); textcolor(GREEN); gotoxy(5,2); cprintf("Room"); gotoxy(35,2); cprintf("Room Code"); gotoxy(68,2); cprintf("Capacity"); for(i=3;i<=77;i++) { textcolor(YELLOW); gotoxy(i,3); cprintf("-"); } i=4; } } fclose(fp); } /******************************MAIN FRAME*********************************/ /*************************THE TIME TABLE GRID*****************************/ void frame1() { int x,y,i,j,h; clrscr(); frame(); for(y=4;y<23;y+=3) { x=2; textcolor(YELLOW); gotoxy(x-1,y); cprintf("%c",204); for(i=0;i<77;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",205); x++; } textcolor(YELLOW); gotoxy(x,y); cprintf("%c",185); } x=8; for(j=0;j<7;j++) { y=2; textcolor(YELLOW); gotoxy(x,y-1); cprintf("%c",203); for(i=0;i<23;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",186); y++; } textcolor(YELLOW); gotoxy(x,y); cprintf("%c",202); x=x+10; } y=4; for(j=0;j<7;j++) { x=8; for(i=0;i<7;i++) { gotoxy(x,y); cprintf("%c",206); x+=10; } y+=3; } gotoxy(1,1); cprintf("%c",201); gotoxy(1,49); cprintf("%c",200); gotoxy(79,1); cprintf("%c",187); gotoxy(79,49); cprintf("%c",188); } /*****************************THE MAIN DISPLAY*****************************/ /*************************OUTPUT OF THE TIME TABLE*************************/ void timetable(char sem,char br) { int i,j,x,y; struct time { char teach[25],sub[15],room[5]; }t; FILE *fp; if(br=='1') switch(sem) { case '1': fp=fopen("sem1cse.txt","r"); break; case '2': fp=fopen("sem2cse.txt","r"); break; case '3': fp=fopen("sem3cse.txt","r"); break; case '4': fp=fopen("sem4cse.txt","r"); break; case '5': fp=fopen("sem5cse.txt","r"); break; case '6': fp=fopen("sem6cse.txt","r"); break; case '7': fp=fopen("sem7cse.txt","r"); break; case '8': fp=fopen("sem8cse.txt","r"); break; default: getch(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); } else if(br=='2') switch(sem) { case '1': fp=fopen("sem1ece.txt","r"); break; case '2': fp=fopen("sem2ece.txt","r"); break; case '3': fp=fopen("sem3ece.txt","r"); break; case '4': fp=fopen("sem4ece.txt","r"); break; case '5': fp=fopen("sem5ece.txt","r"); break; case '6': fp=fopen("sem6ece.txt","r"); break; case '7': fp=fopen("sem7ece.txt","r"); break; case '8': fp=fopen("sem8ece.txt","r"); break; default: getch(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); break; } else if(br=='3') switch(sem) { case '1': fp=fopen("sem1civ.txt","r"); break; case '2': fp=fopen("sem2civ.txt","r"); break; case '3': fp=fopen("sem3civ.txt","r"); break; case '4': fp=fopen("sem4civ.txt","r"); break; case '5': fp=fopen("sem5civ.txt","r"); break; case '6': fp=fopen("sem6civ.txt","r"); break; case '7': fp=fopen("sem7civ.txt","r"); break; case '8': fp=fopen("sem8civ.txt","r"); break; default: clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); break; } else if(br=='4') switch(sem) { case '1': fp=fopen("sem1che.txt","r"); break; case '2': fp=fopen("sem2che.txt","r"); break; case '3': fp=fopen("sem3che.txt","r"); break; case '4': fp=fopen("sem4che.txt","r"); break; case '5': fp=fopen("sem5che.txt","r"); break; case '6': fp=fopen("sem6che.txt","r"); break; case '7': fp=fopen("sem7che.txt","r"); break; case '8': fp=fopen("sem8che.txt","r"); break; default: clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); break; } else { clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); } if(fp==NULL) { clrscr(); gotoxy(30,12); textcolor(RED+BLINK); cprintf("Cannot Open File!!"); getch(); exit(); } frame1(); textcolor(RED); gotoxy(3,5); cprintf("MON"); textcolor(RED); gotoxy(3,8); cprintf("TUE"); textcolor(RED); gotoxy(3,11); cprintf("WED"); textcolor(RED); gotoxy(3,14); cprintf("THU"); textcolor(RED); gotoxy(3,17); cprintf("FRI"); textcolor(RED); gotoxy(3,20); cprintf("SAT"); gotoxy(3,23); cprintf("SUN"); gotoxy(11,2); cprintf("9:00"); gotoxy(21,2); cprintf("10:00"); gotoxy(31,2); cprintf("11:00"); gotoxy(41,2); cprintf("12:00"); gotoxy(51,2); cprintf("1:00"); gotoxy(61,2); cprintf("2:00"); gotoxy(71,2); cprintf("3:00"); x=11; y=5; while(fscanf(fp,"%s %s %s",t.teach,t.sub,t.room)!=EOF) { gotoxy(x,y); textcolor(GREEN); cprintf("%s",t.sub); gotoxy(x,y+1); cprintf("%s",t.room); x+=10; if(x>79) { x=11; y+=3; } } fclose(fp); getch(); } /*****************************ANOTHER FRAME********************************/ /****************************THE INPUT FRAME*******************************/ void framei() { int i,x,y; x=23; y=5; clrscr(); for(i=0;i<35;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",205); x++; } x=23; y=20; for(i=0;i<35;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",205); x++; } x=23; y=5; for(i=0;i<15;i++) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",186); y++; } x=57; y=20; for(i=15;i>0;i--) { gotoxy(x,y); textcolor(YELLOW); cprintf("%c",186); y--; } gotoxy(23,5); cprintf("%c",201); gotoxy(23,20); cprintf("%c",200); gotoxy(57,20); cprintf("%c",188); gotoxy(57,5); cprintf("%c", 187); } /************ *****************TEACHER COMES*******************************/ /**********************INPUT FOR TEACHER'S DATAS**************************/ void teacheri() { int i; char nam[25],sub[10],room[20],ch; FILE *fp; fp=fopen("teacher.txt","a"); if(fp==NULL) { gotoxy(30,12); textcolor(RED+BLINK); cprintf("Cannot Open File!!"); exit(); } framei(); gotoxy(32,4); textcolor(RED+BLINK); cprintf("CHECK TEACHER"); gotoxy(25,6); textcolor(GREEN); cprintf("1.ENTER NAME OF TEACHER "); gotoxy(27,7); gets(nam); for(i=0;nam[i]!='\0';i++) if(nam[i]==' ') nam[i]='_'; gotoxy(25,8); cprintf("2.ENTER SUBJECT "); gotoxy(27,9); gets(sub); for(i=0;sub[i]!='\0';i++) if(sub[i]==' ') sub[i]='_'; gotoxy(25,10); cprintf("3.ENTER ROOM REQUIRED"); gotoxy(27,11); gets(room); for(i=0;room[i]!='\0';i++) if(room[i]==' ') room[i]=','; gotoxy(29,19); textcolor(MAGENTA + BLINK); cprintf("SAVE CHANGES (y/n)?"); ch=getch(); if(ch=='y'||ch=='Y') { fprintf(fp,"%s %s %s ",nam,sub,room); fflush(stdin); } fclose(fp); } /********************************NEW ROOM**********************************/ /************************INPUT FOR ROOM'S DATAS****************************/ void roomi() { int cap,i; char rt[15],rn[5],ch; FILE *fp; fp=fopen("room.txt","a"); if(fp==NULL) { gotoxy(30,12); textcolor(RED+BLINK); cprintf("Cannot Open File!!"); exit(); } clrscr(); framei(); gotoxy(32,4); textcolor(RED+BLINK); cprintf("CHECKROOM"); gotoxy(25,7); textcolor(GREEN); cprintf(" 1. ENTER ROOM TYPE "); gotoxy(27,8); gets(rt); for(i=0;rt[i]!='\0';i++) if(rt[i]==' ') rt[i]='_'; gotoxy(25,9); cprintf(" 2. ENTER ROOM NUMBER "); gotoxy(27,10); gets(rn); gotoxy(25,11); cprintf(" 3. ENTER CAPACITY"); gotoxy(27,12); scanf("%d",&cap); gotoxy(28,19); textcolor(MAGENTA + BLINK); cprintf("SAVE CHANGES (y/n)?"); ch=getch(); if(ch=='y'||ch=='Y') { fprintf(fp,"%s %s %d",rt,rn,cap); fflush(stdin); } fclose(fp); } /*****************************TIME TABLE ENTRY*******************************/ /***************************INPUT FOR TIME TABLE*****************************/ void timetablei(char sem,char br) { int i,j,k,p=0; char teach[25],sub[15],room[5]; FILE *fp; if(br=='1') switch(sem) { case '1': fp=fopen("sem1cse.txt","w"); break; case '2': fp=fopen("sem2cse.txt","w"); break; case '3': fp=fopen("sem3cse.txt","w"); break; case '4': fp=fopen("sem4cse.txt","w"); break; case '5': fp=fopen("sem5cse.txt","w"); break; case '6': fp=fopen("sem6cse.txt","w"); break; case '7': fp=fopen("sem7cse.txt","w"); break; case '8': fp=fopen("sem8cse.txt","w"); break; default: clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); break; } else if(br=='2') switch(sem) { case '1': fp=fopen("sem1ece.txt","w"); break; case '2': fp=fopen("sem2ece.txt","w"); break; case '3': fp=fopen("sem3ece.txt","w"); break; case '4': fp=fopen("sem4ece.txt","w"); break; case '5': fp=fopen("sem5ece.txt","w"); break; case '6': fp=fopen("sem6ece.txt","w"); break; case '7': fp=fopen("sem7ece.txt","w"); break; case '8': fp=fopen("sem8ece.txt","w"); break; default: clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); break; } else if(br=='3') switch(sem) { case '1': fp=fopen("sem1civ.txt","w"); break; case '2': fp=fopen("sem2civ.txt","w"); break; case '3': fp=fopen("sem3civ.txt","w"); break; case '4': fp=fopen("sem4civ.txt","w"); break; case '5': fp=fopen("sem5civ.txt","w"); break; case '6': fp=fopen("sem6civ.txt","w"); break; case '7': fp=fopen("sem7civ.txt","w"); break; case '8': fp=fopen("sem8civ.txt","w"); break; default: clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); break; } else if(br=='4') switch(sem) { case '1': fp=fopen("sem1che.txt","w"); break; case '2': fp=fopen("sem2che.txt","w"); break; case '3': fp=fopen("sem3che.txt","w"); break; case '4': fp=fopen("sem4che.txt","w"); break; case '5': fp=fopen("sem5che.txt","w"); break; case '6': fp=fopen("sem6che.txt","w"); break; case '7': fp=fopen("sem7che.txt","w"); break; case '8': fp=fopen("sem8che.txt","w"); break; default: clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); break; } else { textcolor(RED+BLINK); gotoxy(30,12); cprintf("WRONG CHOICE!!"); getch(); } if(fp==NULL) { gotoxy(30,12); textcolor(RED+BLINK); cprintf("Cannot Open File!!"); getch(); exit(); } for(j=1;j<=6;j++) { clrscr(); gotoxy(30,13); textcolor(RED); cprintf("ENTER DETAILS FOR DAY %d",j); getch(); for(i=1;i<8;i++) { framei(); textcolor(WHITE); gotoxy(29,4); textcolor(RED+BLINK); cprintf(" TIME TABLE DETAILS"); gotoxy(25,7); textcolor(GREEN); cprintf(" 1. ENTER NAME OF TEACHER "); gotoxy(27,8); gets(teach); for(k=0;teach[k]!='\0';k++) if(teach[k]==' ') teach[k]='_'; gotoxy(25,9); cprintf(" 2. ENTER SUBJECT "); gotoxy(27,10); gets(sub); gotoxy(25,11); cprintf("3. ENTER ROOM"); gotoxy(27,12); gets(room); p=rep(sem,br,teach,room,i,j); if(p==1) { clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("TEACHER IS REPEATED!!"); getch(); i--; } else if(p==2) { clrscr(); textcolor(RED+BLINK); gotoxy(30,12); cprintf("ROOM IS REPEATED!!"); getch(); i--; } else { fprintf(fp,"%s %s %s ",teach,sub,room); fflush(stdin); } } fprintf(fp,"\n"); } fclose(fp); } /******************************TEACHER GOES********************************/ /**********************REMOVING TEACHER FROM LIST**************************/ void teacherr() { int i; struct teacher { char nam[25],sub[10],room[20]; }t; char name[25],ch; FILE *fp,*ft; if(fp==NULL) { gotoxy(30,12); textcolor(RED+BLINK); cprintf("Cannot Open File!!"); exit(); } clrscr(); fp=fopen("teacher.txt","rb+"); framei(); gotoxy(30,4); textcolor(RED+BLINK); cprintf("REMOVE TEACHER"); gotoxy(25,6); textcolor(GREEN); cprintf("1.ENTER NAME OF TEACHER "); gotoxy(27,8); gets(name); for(i=0;name[i]!='\0';i++) if(name[i]==' ') name[i]='_'; gotoxy(27,19); textcolor(MAGENTA + BLINK); cprintf("SURE TO REMOVE (y/n)?"); ch=getch(); if(ch=='y'||'Y') { ft=fopen("temp.txt","wb"); rewind(fp); while(fscanf(fp,"%s %s %s",t.nam,t.sub,t.room)!=EOF) { if(strcmp(t.nam,name)!=0) fprintf(ft,"%s %s %s ",t.nam,t.sub,t.room); } fclose(ft); fclose(fp); remove("teacher.txt"); rename("temp.txt","teacher.txt"); } } /******************************ROOM BLOCKS********************************/ /***********************REMOVING ROOM FROM LIST***************************/ void roomr() { int i; struct room { char rt[20],rn[15]; int cap; }r; char rno[15],ch; FILE *fp,*ft; clrscr(); fp=fopen("room.txt","rb+"); if(fp==NULL) { gotoxy(30,12); textcolor(RED+BLINK); cprintf("Cannot Open File!!"); exit(); } framei(); gotoxy(30,4); textcolor(RED+BLINK); cprintf("REMOVE ROOM"); gotoxy(25,6); textcolor(GREEN); cprintf("1.ENTER ROOM NUMBER "); gotoxy(27,8); gets(rno); gotoxy(27,19); textcolor(MAGENTA + BLINK); cprintf("SURE TO REMOVE (y/n)?"); ch=getche(); if(ch=='y'||ch=='Y') { ft=fopen("temp.txt","wb"); rewind(fp); while(fscanf(fp,"%s %s %d",r.rt,r.rn,&r.cap)!=EOF) { if(strcmp(r.rn,rno)!=0) fprintf(ft,"%s %s %d ",r.rt,r.rn,r.cap); fflush(stdin); } fclose(ft); fclose(fp); remove("room.txt"); rename("temp.txt","room.txt"); } } /****************************OOPS! A REPETITION*****************************/ /*****************FUNCTION TO CHECK REPETITION OF INPUT DATA****************/ int rep(char sem,char br,char teach[25],char room[5],int i,int j) { FILE *fp; int m; struct cmp { char teach[25],room[5],sub[10]; }c; if(br=='1' && sem=='1') goto next11; fp=fopen("sem1cse.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next11: if(br=='1' && sem=='2') goto next12; fp=fopen("sem2cse.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next12: if(br=='1' && sem=='3') goto next13; fp=fopen("sem3cse.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next13: if(br=='1' && sem=='4') goto next14; fp=fopen("sem4cse.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next14: if(br=='1' && sem=='5') goto next15; fp=fopen("sem5cse.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next15: if(br=='1' && sem=='6') goto next16; fp=fopen("sem6cse.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next16: if(br=='1' && sem=='7') goto next17; fp=fopen("sem7cse.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next17: if(br=='1' && sem=='8') goto next18; fp=fopen("sem8cse.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next18: if(br=='2' && sem=='1') goto next21; fp=fopen("sem1ece.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next21: if(br=='2' && sem=='2') goto next22; fp=fopen("sem2ece.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next22: if(br=='2' && sem=='3') goto next23; fp=fopen("sem3ece.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next23: if(br=='2' && sem=='4') goto next24; fp=fopen("sem4ece.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next24: if(br=='2' && sem=='5') goto next25; fp=fopen("sem5ece.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next25: if(br=='2' && sem=='6') goto next26; fp=fopen("sem6ece.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next26: if(br=='2' && sem=='7') goto next27; fp=fopen("sem7ece.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next27: if(br=='2' && sem=='8') goto next28; fp=fopen("sem8ece.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next28: if(br=='3' && sem=='1') goto next31; fp=fopen("sem1civ.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next31: if(br=='3' && sem=='2') goto next32; fp=fopen("sem2civ.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next32: if(br=='3' && sem=='3') goto next13; fp=fopen("sem3civ.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next33: if(br=='3' && sem=='4') goto next34; fp=fopen("sem4civ.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (1); } fclose(fp); next34: if(br=='3' && sem=='5') goto next35; fp=fopen("sem5civ.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next35: if(br=='3' && sem=='6') goto next36; fp=fopen("sem6civ.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next36: if(br=='3' && sem=='7') goto next37; fp=fopen("sem7civ.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next37: if(br=='3' && sem=='8') goto next38; fp=fopen("sem8civ.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next38: if(br=='4' && sem=='1') goto next41; fp=fopen("sem1che.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next41: if(br=='4' && sem=='2') goto next42; fp=fopen("sem2che.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next42: if(br=='4' && sem=='3') goto next43; fp=fopen("sem3che.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next43: if(br=='4' && sem=='4') goto next44; fp=fopen("sem4che.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next44: if(br=='4' && sem=='5') goto next45; fp=fopen("sem5che.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next45: if(br=='4' && sem=='6') goto next46; fp=fopen("sem6che.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next46: if(br=='4' && sem=='7') goto next47; fp=fopen("sem7che.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next47: if(br=='4' && sem=='8') goto next48; fp=fopen("sem8che.txt","r"); for(m=0;m<=i+j;m++) fscanf(fp,"%s %s %s",c.teach,c.sub,c.room); if(strcmp(c.teach,teach)==0) { return (1); } if(strcmp(c.room,room)==0) { return (2); } fclose(fp); next48: return (0); } /******************************WHICH SEMESTER?******************************/ /***************************FUNCTION FOR SEMESTER***************************/ char semester() { char ch; framei(); gotoxy(29,4); textcolor(RED+BLINK); cprintf("SEMESTER"); gotoxy(25,7); textcolor(GREEN); cprintf("1.SEMESTER"); gotoxy(25,8); cprintf("2.SEMESTER"); gotoxy(25,9); cprintf("3.SEMESTER"); gotoxy(25,10); cprintf("4.SEMESTER"); gotoxy(25,11); cprintf("5.SEMESTER"); gotoxy(25,12); cprintf("6.SEMESTER"); gotoxy(25,13); cprintf("7.SEMESTER"); gotoxy(25,14); cprintf("8.SEMESTER"); textcolor(MAGENTA); gotoxy(27,19); cprintf("ENTER CHOICE:"); ch=getche(); return(ch); } /***************************WHICH BRANCH?*********************************/ /************************SELECTION OF BRANCH******************************/ char branch() { char ch; framei(); gotoxy(31,4); textcolor(RED+BLINK); cprintf("BRANCH"); gotoxy(25,7); textcolor(GREEN); cprintf("1.COMPUTER SCIENCE"); gotoxy(25,9); cprintf("2.ELECTRONICS"); gotoxy(25,11); cprintf("3.CIVIL"); gotoxy(25,13); cprintf("4.CHEMICAL"); textcolor(MAGENTA); gotoxy(27,19); cprintf("ENTER CHOICE:"); ch=getche(); return(ch); } /***************************THE COLLECTION**********************************/ /**************************THE MAIN FUNCTION********************************/ void main() { char ch='a',sem,br; clrscr(); first(); while(ch!='0') { ch=file(); textcolor(WHITE); switch (ch) { case '0': break; case '1': teacheri(); break; case '2': roomi(); break; case '3': teacherr (); break; case '4': roomr(); break; case '5': frame(); teacher(); getch(); break; case '6': frame(); room(); getch(); break; case '7': sem=semester(); br=branch(); timetablei(sem,br); break; case '8': sem=semester(); br=branch(); timetable(sem,br); break; default: textcolor(RED+BLINK); gotoxy(30,10); cprintf("WRONG CHOICE!!!"); getch(); break; } } } /**************************************************************************/ /********************************THE END***********************************/ /**************************************************************************/

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi ¦Õ¤ ?¤Ð Ãß??ÝÐÝ
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
A timepass game between atmost two players Rahul Roy
Simple Tic Tac Toe Game Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptId=1231


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review