用c语言设计一个学生信息管理系统,急啊.谢谢

发布网友 发布时间:2022-04-19 23:06

我来回答

5个回答

懂视网 时间:2022-05-06 21:58

学生信息管理系统的VB程序界面信息与数据库的信息相对应,在编写代码的时候,要清楚的了解,界面与后台信息两者之间的联系,从全局把握。 界面上对班级信息的操作,主要对信息的添加,修改,删除。而对应到数据库则也是对信息的增,改,删。更新数据库,实现

学生信息管理系统的VB程序界面信息与数据库的信息相对应,在编写代码的时候,要清楚的了解,界面与后台信息两者之间的联系,从全局把握。

界面上对班级信息的操作,主要对信息的添加,修改,删除。而对应到数据库则也是对信息的增,改,删。更新数据库,实现信息的同步。

学生管理系统是一个数据库,班级信息等这一类是数据表,而具体的信息如班号,年级是一个字段。

界面信息:

数据库中的数据表:

热心网友 时间:2022-05-06 19:06

#includenbsp;“stdio.h“#definenbsp;SIZEnbsp;50intnbsp;sum=0;staticnbsp;charnbsp;*str[]={“C“,“Math“,“English“};structnbsp;studentnbsp;nbsp;{nbsp;intnbsp;n;nbsp;nbsp;nbsp;nbsp;longnbsp;num;nbsp;nbsp;nbsp;nbsp;charnbsp;name[10];nbsp;nbsp;nbsp;nbsp;intnbsp;age;nbsp;nbsp;nbsp;nbsp;charnbsp;addr[10];nbsp;nbsp;nbsp;nbsp;intnbsp;score[3];nbsp;nbsp;nbsp;nbsp;floatnbsp;avr;nbsp;nbsp;}nbsp;stu[SIZE];/*nbsp;1--Inputnbsp;*/voidnbsp;fin(){nbsp;intnbsp;i,j,s;charnbsp;f;nbsp;nbsp;FILEnbsp;*fp;nbsp;nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Warring!nbsp;Input?nbsp;(nbsp;y/nnbsp;)nbsp;:nbsp;777“);nbsp;nbsp;f=getchar();f=getchar();nbsp;nbsp;if(f!=‘y‘)nbsp;nbsp;nbsp;nbsp;return;nbsp;nbsp;fp=fopen(“fstu“,“wb“);nbsp;nbsp;for(i=0;iamp;lt;SIZE;i++)nbsp;nbsp;nbsp;nbsp;{nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;i=%dnbsp;Inputnbsp;No.nbsp;(i=-1,return)nbsp;i=?nbsp;“,i+1);nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;scanf(“%d“,amp;j);nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;ifnbsp;(j==-1)nbsp;{nbsp;printf(“
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;*nbsp;*nbsp;*nbsp;Pressnbsp;anynbsp;keynbsp;return!nbsp;*nbsp;*nbsp;*
“,j);nbsp;nbsp;nbsp;fclose(fp);getch();return;nbsp;}nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;elsenbsp;{nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Inputnbsp;num,name,age,addrnbsp;:nbsp;“);nbsp;nbsp;nbsp;stu[i].n=i+1;nbsp;nbsp;nbsp;scanf(“%ld%s%d%s“,amp;stu[i].num,stu[i].name,amp;stu[i].age,stu[i].addr);nbsp;nbsp;nbsp;s=0;nbsp;nbsp;nbsp;for(j=0;jamp;lt;3;j++)nbsp;nbsp;nbsp;nbsp;{nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Inputnbsp;%-7snbsp;scorenbsp;:nbsp;“,str[j]);nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;scanf(“%d“,amp;stu[i].score[j]);nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;if(stu[i].score[j]amp;gt;100)nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;{nbsp;j--;continue;}nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;s+=stu[i].score[j];nbsp;nbsp;nbsp;nbsp;}nbsp;nbsp;nbsp;stu[i].avr=s/3.0;nbsp;nbsp;nbsp;fwrite(amp;stu[i],sizeof(structnbsp;student),1,fp);nbsp;}nbsp;nbsp;nbsp;nbsp;}nbsp;nbsp;fclose(fp);}/*nbsp;2--Findnbsp;*/voidnbsp;ffind(){nbsp;intnbsp;i,j;nbsp;nbsp;FILEnbsp;*fp;nbsp;nbsp;fp=fopen(“fstu“,“rb“);nbsp;nbsp;for(i=0;fread(amp;stu[i],sizeof(structnbsp;student),1,fp)!=0;i++);nbsp;nbsp;sum=i;nbsp;nbsp;rewind(fp);nbsp;nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;*nbsp;*nbsp;*nbsp;Findnbsp;studentnbsp;datanbsp;*nbsp;*nbsp;*
“);nbsp;nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Inputnbsp;n=1nbsp;--nbsp;%dnbsp;:nbsp;“,sum);nbsp;nbsp;scanf(“%d“,amp;j);nbsp;nbsp;fseek(fp,(j-1)*sizeof(structnbsp;student),0);nbsp;nbsp;printf(“
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Displaynbsp;studentnbsp;%dnbsp;datanbsp;:nbsp;
“,j);nbsp;nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*nbsp;*
“);nbsp;nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;No.nbsp;Numnbsp;nbsp;nbsp;nbsp;Namenbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Agenbsp;Addrnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Cnbsp;nbsp;Mathnbsp;En.nbsp;Aver.
“);nbsp;nbsp;printf(“nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;-----------------------------------------------------
“);nbsp;nbsp;fread(amp;stu[i],sizeof(structnbsp;student),1,fp);nbsp;nbsp;printf(“%12d%7

热心网友 时间:2022-05-06 20:24

你东华的吧

热心网友 时间:2022-05-06 21:59

#include "stdio.h"
#define SIZE 50
int sum=0;
static char *str[]={"C","Math","English"};
struct student
{ int n;
long num;
char name[10];
int age;
char addr[10];
int score[3];
float avr;
} stu[SIZE];
/* 1--Input */
void fin()
{ int i,j,s;char f;
FILE *fp;
printf(" Warring! Input? ( y/n ) : \7\7\7");
f=getchar();f=getchar();
if(f!='y')
return;
fp=fopen("fstu","wb");
for(i=0;i<SIZE;i++)
{ printf(" i=%d Input No. (i=-1,return) i=? ",i+1);
scanf("%d",&j);
if (j==-1)
{ printf("\n * * * Press any key return! * * *\n",j);
fclose(fp);getch();return;
}
else
{ printf(" Input num,name,age,addr : ");
stu[i].n=i+1;
scanf("%ld%s%d%s",&stu[i].num,stu[i].name,&stu[i].age,stu[i].addr);
s=0;
for(j=0;j<3;j++)
{ printf(" Input %-7s score : ",str[j]);
scanf("%d",&stu[i].score[j]);
if(stu[i].score[j]>100)
{ j--;continue;}
s+=stu[i].score[j];
}
stu[i].avr=s/3.0;
fwrite(&stu[i],sizeof(struct student),1,fp);
}
}
fclose(fp);
}
/* 2--Find */
void ffind()
{ int i,j;
FILE *fp;
fp=fopen("fstu","rb");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++);
sum=i;
rewind(fp);
printf(" * * * Find student data * * *\n");
printf(" Input n=1 -- %d : ",sum);
scanf("%d",&j);
fseek(fp,(j-1)*sizeof(struct student),0);
printf("\n Display student %d data : \n",j);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
fread(&stu[i],sizeof(struct student),1,fp);
printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
fclose(fp);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
printf("\n\n");getch();
}
/* 3--Change */
void fchan()
{ int i,j,s,m;char ch;
FILE *fp;
for(;;)
{
fp=fopen("fstu","rb+");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++);
sum=i;
printf(" * * * Change student data * * *\n");
printf(" Input n=1 -- %d : ",sum);
scanf("%d",&j);
m=j-1;
fseek(fp,m*sizeof(struct student),0);
printf("\n Display student %d data : \n",j);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
fread(&stu[i],sizeof(struct student),1,fp);
printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
fclose(fp);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
fclose(fp);printf("\n\n");getch();
fp=fopen("fstu","rb+");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++);
sum=i;
printf(" * * * Change student %d data * * *\n",j);
fseek(fp,m*sizeof(struct student),0);
printf(" i=%d Input No. (i=-1,return) i=? ",j);
scanf("%d",&j);
if (j==-1)
{ printf("\n * * * Press any key return! * * *\n",j);
fclose(fp);getch();return;
}
else
{ printf(" Input num,name,age,addr : ");
stu[i].n=j;
scanf("%ld%s%d%s",&stu[i].num,stu[i].name,&stu[i].age,stu[i].addr);
s=0;
for(j=0;j<3;j++)
{ printf(" Input %-7s score : ",str[j]);
scanf("%d",&stu[i].score[j]);
if(stu[i].score[j]>100)
{ j--;continue;}
s+=stu[i].score[j];
}
}
stu[i].avr=s/3.0;
rewind(fp);
fseek(fp,m*sizeof(struct student),0);
fwrite(&stu[i],sizeof(struct student),1,fp);
fclose(fp);
printf("\n * * * Continue ( y/n ) ? * * *\n",j);
ch=getchar();
if(ch!='y')
return;
}
}
/* 4--Append */
void fappe()
{ int i,j,s;
FILE *fp;
fp=fopen("fstu","ab+");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++);
sum=i;
rewind(fp);
printf(" List student datas : \n\n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++)
{ printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
}
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
getch();
sum=i;
for(i=sum;i<SIZE;i++)
{ printf(" i=%d Input No. (i=-1,return) i=? ",i+1);
scanf("%d",&j);
if (j==-1)
{ printf("\n * * * Press any key return! * * *\n",j);
fclose(fp);getch();return;
}
else
{ printf(" Input num,name,age,addr : ");
stu[i].n=i+1;
scanf("%ld%s%d%s",&stu[i].num,stu[i].name,&stu[i].age,stu[i].addr);
s=0;
for(j=0;j<3;j++)
{ printf(" Input %-7s score : ",str[j]);
scanf("%d",&stu[i].score[j]);
if(stu[i].score[j]>100)
{ j--;continue;}
s+=stu[i].score[j];
}
stu[i].avr=s/3.0;
fwrite(&stu[i],sizeof(struct student),1,fp);
}
}
fclose(fp);
}
/* 5--List */
void flist()
{ int i;
FILE *fp;
fp=fopen("fstu","rb");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++);
sum=i;
rewind(fp);
printf(" List student datas : \n\n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++)
{ printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
}
fclose(fp);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
getch();
}
/* 6--Sort */
void fsort()
{ int i,j,n;
FILE *fp;
struct student t;
fp=fopen("fstu","rb");
printf(" List fstu file data : \n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++)
{ printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
}
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
getch();
n=i;
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
if(stu[i].avr<stu[j].avr)
{ t=stu[i];
stu[i]=stu[j];
stu[j]=t;
}
fp=fopen("fstus","wb");
printf(" List sort fstus file data : \n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
for(i=0;i<n;i++)
{ fwrite(&stu[i],sizeof(struct student),1,fp);
printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
}
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
printf("\n");getch();
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++)
fwrite(&stu[i],sizeof(struct student),1,fp);
fclose(fp);
}
/* 7--Copy */
void fcopy()
{ int i;
FILE *fp1,*fp2;
fp1=fopen("fstu","rb");
fp2=fopen("fstub","wb");
printf(" List fstu file data : \n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp1)!=0;i++)
{ printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
fwrite(&stu[i],sizeof(struct student),1,fp2);
}
fclose(fp2);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
printf("\n");getch();
for(i=0;fread(&stu[i],sizeof(struct student),1,fp1)!=0;i++)
fwrite(&stu[i],sizeof(struct student),1,fp2);
fclose(fp1);
fclose(fp2);
fp2=fopen("fstub","rb");
printf(" List backup fstub file data : \n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp2)!=0;i++)
{ printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
}
fclose(fp2);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
getch();printf("\n");
}
/* 8--Restore */
void frest()
{ int i;
FILE *fp1,*fp2;
fp1=fopen("fstub","rb");
fp2=fopen("fstu","wb");
printf(" List backup fstub file data : \n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp1)!=0;i++)
{ printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
fwrite(&stu[i],sizeof(struct student),1,fp2);
}
fclose(fp1);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
printf("\n");getch();
for(i=0;fread(&stu[i],sizeof(struct student),1,fp1)!=0;i++)
fwrite(&stu[i],sizeof(struct student),1,fp2);
fclose(fp1);
fclose(fp2);
fp2=fopen("fstu","rb");
printf(" List fstu file data : \n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf(" No. Num Name Age Addr C Math En. Aver.\n");
printf(" -----------------------------------------------------\n");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp2)!=0;i++)
{ printf("%12d%7ld %-10s%2d %-10s",stu[i].n,stu[i].num,stu[i].name,stu[i].age,stu[i].addr);
printf("%3d %3d %3d %6.2f\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].avr);
}
fclose(fp2);
printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
getch();printf("\n");
}
main()
{ int n;
for(;;)
{ printf("\n\n\n\n\n\n\n\n\n\n\n\n");
printf(" * * * * * * * * * * * * * * * * * *\n");
printf(" * Student M I S *\n");
printf(" * * * * * * * * * * * * * * * * * *\n");
printf(" * 1. Input student data *\n");
printf(" * 2. Find student data *\n");
printf(" * 3. Change student data *\n");
printf(" * 4. Append student data *\n");
printf(" * 5. List student data *\n");
printf(" * 6. Sort student file *\n");
printf(" * 7. Copy backup file *\n");
printf(" * 8. Restore backup file *\n");
printf(" * * * * * * * * * * * * * * * * * *\n");
printf(" * 0. Exit system *\n");
printf(" * * * * * * * * * * * * * * * * * *\n\n");
printf(" Please Enter ( 0 -- 8 ) : ");
scanf("%d",&n);
printf("\n\n\n\n\n");
switch(n)
{ case 1 : fin();break;
case 2 : ffind();break;
case 3 : fchan();break;
case 4 : fappe();break;
case 5 : flist();break;
case 6 : fsort();break;
case 7 : fcopy();break;
case 8 : frest();break;
case 0 : printf(" * * * * * * * * * * * * * * * * * *\n");
printf(" * *\n");
printf(" * Finish ! *\n");
printf(" * *\n");
printf(" * * * * * * * * * * * * * * * * * *\n");
printf(" * *\n");
printf(" * Good Bye ! *\n");
printf(" * *\n");
printf(" * * * * * * * * * * * * * * * * * *\n\n");
getch();exit();
default: printf(" * * * Error ! Press any key continue. * * *\n");
getch();break;
}
}
}

热心网友 时间:2022-05-06 23:50

在给我补充点分 哈哈 我毕业设计也是做的这个 我找找

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com