void center(int y,char string||) int x(80-strlen(string)1)/2; gotoxy(x,y);printI("s",string); }
void Create(void) char opt; center(21,"WARNING!!!"); center(22,"You are about to create a new Iile"); center(23,"This will erase all records in the Iile..."); center(24,"Are you sure you want to proceed?|Y/N| "); optgetche(); opttoupper(opt); iI(opt'Y') IpIopen("Group4.txt","w"); center(24," "); center(24,"File successIully created!"); } getch(); Iclose(Ip); } void Add(void) char opt; IpIopen("Group4.txt","a");
clrscr(); Temp1(); gotoxy(19,8); scanI(" "); gets(record.snum); gotoxy(19,10); scanI(" "); gets(record.Iname); gotoxy(19,12); scanI(" "); gets(record.sname); gotoxy(19,14); record.migetche(); record.mitoupper(record.mi); gotoxy(19,16); record.ccodegetche(); record.ccodetoupper(record.ccode); gotoxy(5,22); clreol(); printxy(79,22,""); IprintI(Ip,"s s s c c",record.snum,record.Iname,record.sname,record.mi,record.ccode); gotoxy(5,21); clreol(); center(21,"Record successIully added!"); printxy(79,21,""); gotoxy(53,22); delay(1000); center(22,"Press any key to go to main menu..."); getch(); Iclose(Ip); }
void List(void) int count0,i,x0,page1,CS0,IT0,Serv0;
IpIopen("Group4.txt","r");
clrscr(); center(2,"Polytechnic University oI the Philippines"); center(3,"Sta. Mesa, Manila"); center(5,"College oI Computer Management and InIormation Technology"); printxy(10,7,"Record Student # Name Course"); Ior(i1;i80;i) gotoxy(i,8); puts("I"); /*Alt-205*/ }
while(IscanI(Ip,"s s s c c",&record.snum,&record.Iname,&record.sname,&record.mi,&record.ccode)!EO F) iI(count!0&&count50) printxy(5,23,"Press any key to continue..."); getch(); x0; Ior(i10;i24;i)gotoxy(1,i); clreol();} page; } gotoxy(70,4); printI("Page d",page); gotoxy(13,10x); printI("d",count1); gotoxy(19,10x); printI("s",record.snum); gotoxy(37,10x); printI("s, s c.",record.sname,record.Iname,record.mi); gotoxy(62,10x); switch(record.ccode) case 'A': printI("CompSci"); CS; break; case 'B': printI("InIoTech"); IT; break; deIault : printI("Services"); Serv; break; } x; count; } printxy(25,17,"TOTAL"); gotoxy(15,18); printI("Comp Sci: d",CS); gotoxy(15,19); printI("InIoTech: d",IT); gotoxy(15,20); printI("Services: d",Serv); printxy(5,23,"Press any key to go to main menu..."); getch();