c語言 學(xué)生管理系統(tǒng) 不雷同
《c語言 學(xué)生管理系統(tǒng) 不雷同》由會員分享,可在線閱讀,更多相關(guān)《c語言 學(xué)生管理系統(tǒng) 不雷同(17頁珍藏版)》請在裝配圖網(wǎng)上搜索。
1、 #include"stdio.h" /*學(xué)生成績管理系統(tǒng)*/ #include"string.h" #include"stdlib.h" #include"conio.h" /*函數(shù) getch() 所需頭文件*/ int m,n; FILE *fr; char fname[81]; struct ke /*建立科目結(jié)構(gòu)體*/ { int dianfen; /*電路分析*/ int gaoshu; /*高等數(shù)學(xué)*/ int yingyu; /*大學(xué)英語*/ int dawu; /*大學(xué)物理*/ }; struct student
2、/*建立學(xué)生結(jié)構(gòu)體*/ { long num; /*學(xué)號*/ char name[21]; /*姓名*/ char xibie[21]; /*系別*/ char banji[21]; /*班級*/ struct ke kemu; /*科目*/ int zongfen; /*總分*/ }*s; void find(); /*函數(shù)說明*/ void menu(); /*函數(shù)說明*/ void xpm(); /*函數(shù)說明*/ void bpm(); /*函數(shù)說明*/ void xifen(); /*函數(shù)說明*/
3、 void paim(); /*函數(shù)說明*/ void xi() /*按系查詢*/ {int i,j=0;char k[21]; clrscr(); printf("Please enter the Department to query:");/*請輸入所要查詢的系*/ scanf("%s",k); printf("%10s%10s%10s%10s%8s%7s%7s%7s%10s\n","xuehao","xingming","xibie","banji","dianfen","gaoshu","yingyu","dawu","zongfen"); for(
4、i=0;i 5、intf("Press any key to continue.\n");
getch();
find();
}
void banji() /*按班級查詢*/
{
int i,j=0;char k[21];
clrscr();
printf("Please enter the class to query:"); /*請輸入所要查詢的班級*/
scanf("%s",k);
printf("%10s%10s%10s%10s%8s%7s%7s%7s%10s\n","xuehao","xingming","xibie","banji","dianfen","g 6、aoshu","yingyu","dawu","zongfen");
for(i=0;i 7、ass %s has %d student.\n",k,j);
printf("Press any key to continue.\n");
getch();
find();
}
void df() /*查詢電路分析成績*/
{
int i,j,t,k;int p[20];
clrscr();
for(i=0;i 8、;i++) /*索引排序*/
for(j=0;j 9、.\n");
getch();
find();
}
void gs() /*查詢高等數(shù)學(xué)成績*/
{
int i,j,t,k;int p[20];
clrscr();
for(i=0;i 10、p[j+1]].kemu.gaoshu)
{t=p[j];p[j]=p[j+1];p[j+1]=t;}
for(k=0;k 11、j,t,k;int p[20];
clrscr();
for(i=0;i 12、;k 13、 printf("%10s%10s%10s%10s%10s\n","xuehao","xingming","xibie","banji","dawu");
for(i=1;i 14、[k]].xibie,s[p[k]].banji,s[p[k]].kemu.dawu);}
printf("Press any key to continue.\n");
getch();
find();
}
void kemu() /*按科目查詢*/
{clrscr();
printf("\t\t\t*****----------*****\n");
printf("\t\t\t*** 1:Dian fen ***\n");
printf("\t\t\t*** 2:Gao shu ***\n");
printf("\t\t\t*** 3 15、:Ying yu ***\n");
printf("\t\t\t*** 4:Da wu ***\n");
printf("\t\t\t*** 0:Return ***\n");
printf("\t\t\t*****----------*****\n");
printf("Please enter your choice(0-4):");
scanf("%d",&m);
switch(m)
{case 0:find();break;
case 1:df();break;
case 2:gs();break;
case 16、 3:yy();break;
case 4:dw();break;
default:printf("Input error!\n");printf("Press any key to continue.\n");getch();kemu();
}
}
void xueh() /*修改學(xué)號*/
{int i;char k[20];
clrscr();
printf("Input the student's name:");
scanf("%s",k);
for(i=0;i 17、 {
printf("Ipnut the xuehao:");
scanf("%ld",&s[i].num);
}
}
void xingm() /*修改姓名*/
{int i;char k[20];
clrscr();
printf("Input the student's name:");
scanf("%s",k);
for(i=0;i 18、
}
void xib() /*修改系別*/
{int i;char k[20];
clrscr();
printf("Input the student's name:");
scanf("%s",k);
for(i=0;i 19、nput the student's name:");
scanf("%s",k);
for(i=0;i 20、
if(strcmp(k,s[i].name)==0)
{
printf("Ipnut the dian fen cheng ji:");
scanf("%d",&s[i].kemu.dianfen);
}
}
void gaos()/*修改高等數(shù)學(xué)成績*/
{int i;char k[20];
clrscr();
printf("Input the student's name:");
scanf("%s",k);
for(i=0;i 21、("Ipnut the gao shu cheng ji:");
scanf("%d",&s[i].kemu.gaoshu);
}
}
void yingy()/*修改大學(xué)英語成績*/
{int i;char k[20];
clrscr();
printf("Input the student's name:");
scanf("%s",k);
for(i=0;i 22、",&s[i].kemu.yingyu);
}
}
void daw()/*修改大學(xué)物理成績*/
{int i;char k[20];
clrscr();
printf("Input the student's name:");
scanf("%s",k);
for(i=0;i 23、生信息*/
{char k[20],p[20]="abcd";
clrscr();
printf("Input the password:");
scanf("%s",k);
if(strcmp(k,p)==0)
{clrscr();
printf("\t\t*****-------------------------*****\n");
printf("\t\t*** 1:Modified xuehao ***\n"); /*修改學(xué)號*/
printf("\t\t*** 2:Modified xingming ** 24、*\n"); /*修改姓名*/
printf("\t\t*** 3:Modified xibie ***\n"); /*修改系別*/
printf("\t\t*** 4:Modified banji ***\n"); /*修改班級*/
printf("\t\t*** 5:Modified dianfen score ***\n"); /*修改電路分析成績*/
printf("\t\t*** 6:Modified gaoshu score ***\n"); /*修改高等數(shù)學(xué)成績*/
printf(" 25、\t\t*** 7:Modified yingyu score ***\n"); /*修改大學(xué)英語成績*/
printf("\t\t*** 8:Modified dawu score ***\n"); /*修改大學(xué)物理成績*/
printf("\t\t*** 0:Return ***\n"); /*回到主菜單*/
printf("\t\t*****-------------------------*****\n");
printf("Please enter your choice(0-4):");
26、scanf("%d",&m);
switch(m)
{case 0:break;
case 1:xueh();break;
case 2:xingm();break;
case 3:xib();break;
case 4:banj();break;
case 5:dianf();break;
case 6:gaos();break;
case 7:yingy();break;
case 8:daw();break;
default:printf("Input error!\n");printf("Press a 27、ny key to continue.\n");getch();xiugai();
}
}find();
}
void find() /*查詢菜單*/
{clrscr();
printf("\t\t*****-----------------------------*****\n");
printf("\t\t*** 1:Inquiries by the Department ***\n"); /*按系查詢*/
printf("\t\t*** 2:Inquiries by the class ***\n"); /*按班級查詢*/
pri 28、ntf("\t\t*** 3:Inquiries by the subject ***\n"); /*按科目查詢*/
printf("\t\t*** 4:Modify the basic information ***\n"); /*基本信息修改*/
printf("\t\t*** 0:Back to main menu ***\n"); /*回到主菜單*/
printf("\t\t*****-----------------------------*****\n");
printf("Please enter your choice( 29、0-4):");
scanf("%d",&m);
switch(m)
{case 0:menu();break;
case 1:xi();break;
case 2:banji();break;
case 3:kemu();break;
case 4:xiugai();break;
default:printf("Input error!\n");printf("Press any key to continue.\n");getch();find();
}
}
void xipj() /*按系查詢(求單科平均成績、及格率和 30、優(yōu)秀率)*/
{double a=0,j=0,k=0,l=0;
int i;char f[21];
clrscr();
printf("Please enter the Department to query:");/*請輸入所要查詢的系*/
scanf("%s",f);
for(i=0;i 31、>=90) l++;
}
}
if(j==0)
{printf("Input error!\n");printf("Press any key to continue.\n");getch();}
else
{printf("The Department:%s\nThe dianfen average score is:%5.1lf jigelv:%.1lf%% youxiulv:%.1lf%%\n",f,a/j,k*100/j,l*100/j);
a=0;k=0;l=0;
for(i=0;i 32、mp(f,s[i].xibie)==0)
{
a+=s[i].kemu.gaoshu;
if(s[i].kemu.gaoshu>=60) k++;
if(s[i].kemu.gaoshu>=90) l++;
}
}
printf("The gaoshu average score is:%5.1lf jigelv:%.1lf%% youxiulv:%.1lf%%\n",a/j,k*100/j,l*100/j);
a=0;k=0;l=0;
for(i=0;i 33、[i].xibie)==0)
{
a+=s[i].kemu.yingyu;
if(s[i].kemu.yingyu>=60) k++;
if(s[i].kemu.yingyu>=90) l++;
}
}
printf("The yingyu average score is:%5.1lf jigelv:%.1lf%% youxiulv:%.1lf%%\n",a/j,k*100/j,l*100/j);
a=0;k=0;l=0;
for(i=0;i 34、ibie)==0)
{
a+=s[i].kemu.dawu;
if(s[i].kemu.dawu>=60) k++;
if(s[i].kemu.dawu>=90) l++;
}
}
printf("The dawu average score is:%5.1lf jigelv:%.1lf%% youxiulv:%.1lf%%\n",a/j,k*100/j,l*100/j);
printf("Press any key to continue.\n");
getch();
}
xifen();
}
vo 35、id banpj() /*按班級查詢(求單科平均成績、及格率和優(yōu)秀率)*/
{double a=0,j=0,k=0,l=0;
int i;char f[21];
clrscr();
printf("Please enter the Class to query:");/*請輸入所要查詢的系*/
scanf("%s",f);
for(i=0;i 36、+;
if(s[i].kemu.dianfen>=90) l++;
}
}
if(j==0)
{printf("Input error!\n");printf("Press any key to continue.\n");getch();}
else
{printf("The class:%s\nThe dianfen average scores is:%5.1lf jigelv:%.1lf%% youxiulv:%.1lf%%\n",f,a/j,k*100/j,l*100/j);
a=0;k=0;l=0;
for(i=0;i< 37、n;i++)
{
if(strcmp(f,s[i].banji)==0)
{
a+=s[i].kemu.gaoshu;
if(s[i].kemu.gaoshu>=60) k++;
if(s[i].kemu.gaoshu>=90) l++;
}
}
printf("The gaoshu average scores is:%5.1lf jigelv:%.1lf%% youxiulv:%.1lf%%\n",a/j,k*100/j,l*100/j);
a=0;k=0;l=0;
for(i=0;i 38、
{
if(strcmp(f,s[i].banji)==0)
{
a+=s[i].kemu.yingyu;
if(s[i].kemu.yingyu>=60) k++;
if(s[i].kemu.yingyu>=90) l++;
}
}
printf("The yingyu average scores is:%5.1lf jigelv:%.1lf%% youxiulv:%.1lf%%\n",a/j,k*100/j,l*100/j);
a=0;k=0;l=0;
for(i=0;i 39、
if(strcmp(f,s[i].banji)==0)
{
a+=s[i].kemu.dawu;
if(s[i].kemu.dawu>=60) k++;
if(s[i].kemu.dawu>=90) l++;
}
}
printf("The dawu average scores is:%5.1lf jigelv:%.1lf%% youxiulv:%.1lf%%\n",a/j,k*100/j,l*100/j);
printf("Press any key to continue.\n");
getch( 40、);
}
xifen();
}
void xifen() /* 次菜單 (每系成績分析:求單科平均成績、及格率和優(yōu)秀率)*/
{clrscr();
printf("\t*****----------------------------*****\n");
printf("\t*** 1:Inquiries by the Department ***\n");/*按系查詢*/
printf("\t*** 2:Inquiries by the class ***\n");/*按班級查詢*/
printf("\t*** 0:Back to ma 41、in menu ***\n");/*回到主菜單*/
printf("\t*****----------------------------*****\n");
printf("Please enter your choice(0-2):");
scanf("%d",&m);
switch(m)
{case 0:menu();break;
case 1:xipj();break;
case 2:banpj();break;
default:printf("Input error!\n");printf("Press any ke 42、y to continue.\n");getch();xifen();
}
}
void kefen() /*對所開課程的成績分析(求其平均成績,最高分和最低分)*/
{int i,k1=0,k2=0;double a=0;
clrscr();
for(i=0;i 43、Dianfen*****\naverage score:%.1lf\n",a/n);
printf("highest score:\n");
printf("%ld%10s%10s%10s%6d\n",s[k1].num,s[k1].name,s[k1].xibie,s[k1].banji,s[k1].kemu.dianfen);
printf("lowest score:\n");
printf("%ld%10s%10s%10s%6d\n",s[k2].num,s[k2].name,s[k2].xibie,s[k2].banji,s[k2].kemu.dianfen); 44、 /*電路分析的平均成績和最高低分*/
k1=k2=0;a=0;
for(i=0;i 45、10s%6d\n",s[k1].num,s[k1].name,s[k1].xibie,s[k1].banji,s[k1].kemu.gaoshu);
printf("lowest score:\n");
printf("%ld%10s%10s%10s%6d\n",s[k2].num,s[k2].name,s[k2].xibie,s[k2].banji,s[k2].kemu.gaoshu); /*高等數(shù)學(xué)的平均成績和最高低分*/
printf("Press any key to continue.\n");
getch();
clrscr();
k1=k2= 46、0;a=0;
for(i=0;i 47、,s[k1].xibie,s[k1].banji,s[k1].kemu.yingyu);
printf("lowest score:\n");
printf("%ld%10s%10s%10s%6d\n",s[k2].num,s[k2].name,s[k2].xibie,s[k2].banji,s[k2].kemu.yingyu); /*大學(xué)英語的平均成績和最高低分*/
k1=k2=0;a=0;
for(i=0;i 48、f(s[k2].kemu.dawu>=s[i].kemu.dawu) k2=i;
}
printf("*****Dawu*****\naverage score:%.1lf\n",a/n);
printf("highest score:\n");
printf("%ld%10s%10s%10s%6d\n",s[k1].num,s[k1].name,s[k1].xibie,s[k1].banji,s[k1].kemu.dawu);
printf("lowest score:\n");
printf("%ld%10s%10s%10s%6d\n",s[k2].num 49、,s[k2].name,s[k2].xibie,s[k2].banji,s[k2].kemu.dawu); /*大學(xué)物理的平均成績和最高低分*/
printf("Press any key to continue.\n");
getch();
menu();
}
void xipm() /*按系單科排名*/
{
int i,j,t,a,k=0;int p[20];
char q[20];
clrscr();
printf("Please enter the Department to query:"); /*請輸入所要查詢的系*/
scanf( 50、"%s",q);
/*電路分析科排名*/
printf("***%s xi Dian fen dan ke pai ming ***\n",q);
for(i=0;i 51、+1]=t;}
printf("%10s%10s %8s %8s%8s\n","xuehao","xingming","xibie","banji","dianfen");
for(a=0;a 52、rscr();
/*高等數(shù)學(xué)科排名*/
printf("***%s xi Gao shu dan ke pai ming ***\n",q);
for(i=1;i 53、u");
for(a=0;a 54、;i++) /*索引排序*/
for(j=0;j 55、e,s[p[a]].xibie,s[p[a]].banji,s[p[a]].kemu.yingyu);}
printf("Press any key to continue.\n");
getch();
clrscr();
/*大學(xué)物理科排名*/
printf("***%s xi Da wu dan ke pai ming ***\n",q);
for(i=1;i 56、 {t=p[j];p[j]=p[j+1];p[j+1]=t;}
printf("%10s%10s %8s %8s%8s\n","xuehao","xingming","xibie","banji","dawu");
for(a=0;a 57、
getch();
paim();
}
void banpm() /*按每班總成績排名*/
{int i,j,t,k=0;int p[30];
char q[20];
clrscr();
printf("Please enter the class to query:\n"); /*請輸入所要查詢的班級*/
scanf("%s",q);
for(i=0;i 58、) /*索引排序*/
for(j=0;j 59、s%10s%10s%8d%8d%8d%8d%10d\n",s[p[k]].num,s[p[k]].name,s[p[k]].xibie,s[p[k]].banji,s[p[k]].kemu.dianfen,s[p[k]].kemu.gaoshu,s[p[k]].kemu.yingyu,s[p[k]].kemu.dawu,s[p[k]].zongfen);}
printf("Press any key to continue.\n");
getch();
paim();
}
void paim() /*學(xué)生考試成績排名菜單*/
{clrscr();
print 60、f("\t*****---------------------------------------------------*****\n");
printf("\t*** 1:Billing Division of the rankings by the Department ***\n"); /*按系單科排名*/
printf("\t*** 2:Ranked by total score of the class ***\n"); /*按班總成績排名*/
printf("\t*** 0:Back to main menu 61、 ***\n"); /*回到主菜單*/
printf("\t*****---------------------------------------------------*****\n");
printf("Please enter your choice(0-2):");
scanf("%d",&m);
switch(m)
{case 0:menu();break;
case 1:xipm();break;
case 2:banpm();break;
default:printf("Input er 62、ror!\n");printf("Press any key to continue.\n");getch();paim();
}
}
void save()
{int i;
fr=fopen(fname,"w");
for(i=0;i 63、;
fprintf(fr,"\n");
}
fcloseall();
}
void menu() /*主菜單*/
{clrscr();
printf("\t*****---------------------main menu---------------------*****\n");
printf("\t*** 1:Basic information inquiries ***\n"); /*基本信息的查詢*/
printf("\t*** 2:Department of subjects 64、 for each analysis of results ***\n"); /*對系各科成績的分析*/
printf("\t*** 3:The analysis to the performance of each course ***\n"); /*對所開課程的成績分析*/
printf("\t*** 4:Test scores of students to rank ***\n"); /*對學(xué)生考試成績進(jìn)行排名*/
printf("\t*** 0:Exit the process 65、 ***\n"); /*退出程序*/
printf("\t*****----------------------------------------------------*****\n\n");
printf("Please enter your choice(0-4):");
scanf("%d",&m);
switch(m)
{case 0:save();free((void *)s);printf("Press any key to continue.\n");getch();break;
case 1:fin 66、d();break;
case 2:xifen();break;
case 3:kefen();break;
case 4:paim();break;
default:printf("Input error!\n");printf("Press any key to continue.\n");getch();menu();
}
}
void input()
{int i;
printf("Input the number of the student(<=the number of students in the file):"); /*輸入學(xué)生人數(shù)*/
scanf("%d",&n);
printf("xuehao xingming xibie banji dianfen gaoshu yingyu dawu\n");
s=(struct student *)malloc(n*sizeof(struct student)); /*建立n個學(xué)生成員*/
for(i=0;i
- 溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 建筑施工重大危險源安全管理制度
- 安全培訓(xùn)資料:典型建筑火災(zāi)的防治基本原則與救援技術(shù)
- 企業(yè)雙重預(yù)防體系應(yīng)知應(yīng)會知識問答
- 8 各種煤礦安全考試試題
- 9 危險化學(xué)品經(jīng)營單位安全生產(chǎn)管理人員模擬考試題庫試卷附答案
- 加壓過濾機(jī)司機(jī)技術(shù)操作規(guī)程
- 樹脂砂混砂工藝知識總結(jié)
- XXXXX現(xiàn)場安全應(yīng)急處置預(yù)案
- 某公司消防安全檢查制度總結(jié)
- 1 煤礦安全檢查工(中級)職業(yè)技能理論知識考核試題含答案
- 4.燃?xì)獍踩a(chǎn)企業(yè)主要負(fù)責(zé)人模擬考試題庫試卷含答案
- 工段(班組)級安全檢查表
- D 氯化工藝作業(yè)模擬考試題庫試卷含答案-4
- 建筑起重司索信號工安全操作要點
- 實驗室計量常見的30個問問答題含解析