
| Turbo C - Database Program 1 |
|
#include<conio.h> #include<stdio.h> #include<string.h> #include<stdlib.h> #define UP 0x50 #define DOWN 0x48 #define ENTER 13 char press,entry; int h,p,x1,d,cntr; struct student { char name[30]; char id[7]; float q1; float q2; float q3; }record[60]; main() { int e; char no; textbackground(7); clrscr(); menu(); for(e=1;e<=18;e++) { gotoxy(30-e,23);cprintf("<---- Press 'L' for help... "); delay (1000); } up: do { press=getch(); switch(press) { case 'a': case 'A': menu(); break; case 'b': case 'B': menu1(); break; case 'e': case 'E': menu2(); break; case 'd': case 'D': menu3(); break; case 'l': case 'L': help(); break; case 'q': case 'Q': exit(0); break; } switch(press) { case UP: if(p==1) {menu1();goto up;} if(p==2) {menu2();goto up;} if(p==3) {menu3();goto up;} if(p==4) {menu();goto up;} break; case DOWN: if(p==1) {menu3();goto up;} if(p==2) {menu();goto up;} if(p==3) {menu1();goto up;} if(p==4) {menu2();goto up;} break; } }while(press!=ENTER); if(p==1) add(); if (p==2) browse(); } menu() { int n; clrscr(); textcolor(15); gotoxy(4,22);cprintf("ÚÄÄÄÄÄÄ"); gotoxy(4,23);cprintf("³"); gotoxy(4,24);cprintf("À "); textcolor(0); gotoxy(11,22);cprintf("¿"); gotoxy(5,23);cprintf(" He p ³"); gotoxy(5,24);cprintf("ÄÄÄÄÄÄÙ"); textbackground(7); textcolor(15); gotoxy(70,22);cprintf("ÚÄÄÄÄÄÄ"); gotoxy(70,23);cprintf("³"); gotoxy(70,24);cprintf("À "); textcolor(0); gotoxy(77,22);cprintf("¿"); gotoxy(72,23);cprintf(" uit ³"); gotoxy(71,24);cprintf("ÄÄÄÄÄÄÙ"); textcolor(0); gotoxy(32,4);cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); gotoxy(32,5);cprintf("³ dd"); gotoxy(32,6);cprintf("À"); textcolor(15); gotoxy(49,4);cprintf("¿"); gotoxy(49,5);cprintf("³"); gotoxy(33,6);cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"); textcolor(15); gotoxy(32,7);cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); gotoxy(32,8);cprintf("³ "); gotoxy(32,9);cprintf("À"); textcolor(0); gotoxy(49,7);cprintf("¿"); gotoxy(33,8);cprintf(" rowse ³"); gotoxy(33,9);cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"); textcolor(15); gotoxy(32,10);cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); gotoxy(32,11);cprintf("³ "); gotoxy(32,12);cprintf("À"); textcolor(0); gotoxy(49,10);cprintf("¿"); gotoxy(33,11);cprintf(" dit ³"); gotoxy(33,12);cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"); textcolor(15); gotoxy(32,13);cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); gotoxy(32,14);cprintf("³ "); gotoxy(32,15);cprintf("À"); textcolor(0); gotoxy(49,13);cprintf("¿"); gotoxy(33,14);cprintf(" elete ³"); gotoxy(33,15);cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"); textcolor(4); gotoxy(8,23);cprintf("l"); gotoxy(72,23);cprintf("Q"); gotoxy(39,5);cprintf("A"); gotoxy(38,8);cprintf("B"); gotoxy(39,11);cprintf("E"); gotoxy(38,14);cprintf("D"); textcolor(15); gotoxy(30,16);cprintf("À"); gotoxy(30,3);cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); textcolor(0); gotoxy(51,3);cprintf("¿"); gotoxy(31,16);cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"); for(n=1;n<=12;n++) { textcolor(15); gotoxy(30,n+3);cprintf("³"); textcolor(0); gotoxy(51,n+3);cprintf("³"); } p=1; } menu1() { int n; clrscr(); textcolor(15); gotoxy(4,22);cprintf("ÚÄÄÄÄÄÄ"); gotoxy(4,23);cprintf("³"); gotoxy(4,24);cprintf("À "); textcolor(0); gotoxy(11,22);cprintf("¿"); gotoxy(5,23);cprintf(" He p ³"); gotoxy(5,24);cprintf("ÄÄÄÄÄÄÙ"); textcolor(15); gotoxy(70,22);cprintf("ÚÄÄÄÄÄÄ"); gotoxy(70,23);cprintf("³"); gotoxy(70,24);cprintf("À "); textcolor(0); gotoxy(77,22);cprintf("¿"); gotoxy(72,23);cprintf(" uit ³"); gotoxy(71,24);cprintf("ÄÄÄÄÄÄÙ"); textcolor(15); gotoxy(32,4);cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); gotoxy(32,5);cprintf("³ dd"); |