"Design database of school information system"
Database of 10-20 schools having read and write capabilities using filing for future access to the given information using searching .
i didn't understand that what is filing?
i done a program in structure but don't know how to do in file please solve my problem ..i have to submit this with in a week...
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
struct school
{
char name[100];
char pname[50];
int address;
int pnumb;
char schof[10];
char schtype[50];
char city[50];
};
struct school sch[100];
void main(void)
{
clrscr();
int i,index=0;
int left=18,top=7,right=60,bot=20;
int numcolors=18;
int j;
char repeat='Y';
do
{
printf("\nEntry No.%d\n",index);
printf("Enter school name:");
scanf("%s",sch[index].name);
printf("Enter principle name:");
scanf("%s",sch[index].pname);
printf("Enter street address:");
scanf("%d",sch[index].address);
printf("Enter phone number:");
scanf("%d",sch[index].pnumb);
printf("Enter city name in which it situated:");
scanf("%s",sch[index].city);
printf("Enter school education type:");
scanf("%s",sch[index].schof);
printf("Enter either school is primary or secondary:");
scanf("%s",sch[index].schtype);
index++;
if(index<20)
{
printf("DO YOU HAVE ANOTHER ENTRY? Y or N:");
repeat=getche();
putchar('\n');
}
}
while(index<20&&(repeat=='Y'||repeat=='y'));
clrscr();
gotoxy(18,5);
printf("---------------------------------------------");
window(left,top,right,bot);
for(j=0;j<20;j++);
{
textcolor(j%numcolors);
cputs("** DATABASE OF SCHOOL INFORMATION SYSTEM **");
}
gotoxy(0,3);
printf("--------------------------------------------");
for(i=0;i<index;i++)
{
printf("\n\t\tEntry No.%d\n",index);
printf("\n\n\t\t\tNAME OF SCHOOL:%s",sch[i].name);
printf("\n\n\t\t\tNAME OF PRINCIPLE:%s",sch[i].pname);
printf("\n\n\t\t\tADDRESS:%d",sch[i].address);
printf("\n\n\t\t\tPHONE NUMBER:%d",sch[i].pnumb);
printf("\n\n\t\t\tCITY:%s",sch[i].city);
printf("\n\n\t\t\tEDUCATION TYPE:%s",sch[i].schof);
printf("\n\n\t\t\tPRIMARY OR SECONDARY:%s\n",sch[i].schtype);
}
getch();
}
data base school information system in file