版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
./C語(yǔ)言教務(wù)管理系統(tǒng)一、程序結(jié)構(gòu)圖二、程序運(yùn)行截圖1.個(gè)人信息簡(jiǎn)介2.修改顏色3.注冊(cè)界面4.信息保存至文件5.登錄界面6.管理員錄入信息7.學(xué)生信息錄入8.學(xué)生成績(jī)錄入9.學(xué)生課程表錄入10.學(xué)生信息查詢界面11學(xué)生信息查詢12.學(xué)生成績(jī)查詢13.學(xué)生課表查詢?nèi)?、代碼〔一個(gè)cpp#include<stdio.h>#include<stdlib.h>#include<string.h>#include<ctype.h>#include<conio.h>#include"windows.h"#definestudent_num1000/*定義1000個(gè)學(xué)生*/#defineteacher_num5 /*定義5個(gè)老師〔管理員*/intis_my_student<structstudent*p,int*size>; /*聲明返回第i+1個(gè)學(xué)生的函數(shù)*/intis_my_teacher<structteacher*p,int*size>; /*聲明返回第i+1個(gè)老師的函數(shù)*/intlength_student_name<char*p>; /*聲明驗(yàn)證用戶名函數(shù)*/intlength_student_password<char*p>; /*聲明驗(yàn)證密碼長(zhǎng)度函數(shù)*/intlength_teacher_name<char*p>; /*聲明驗(yàn)證用戶名函數(shù)*/intlength_teacher_password<char*p>; /*聲明驗(yàn)證密碼長(zhǎng)度函數(shù)*/intshow_menu_login<>; /*聲明登錄菜單函數(shù)*/intshow_menu_register<>; /*聲明注冊(cè)菜單函數(shù)*/intshow_teacher_select<>; /*聲明教師錄入菜單函數(shù)*/intshow_student_select<>; /*聲明學(xué)生查詢菜單函數(shù)*/intstudent_register<structstudent*ptr_student,int*size>; /*聲明學(xué)生注冊(cè)函數(shù)*/intteacher_register<structteacher*ptr_teacher,int*size>; /*聲明老師注冊(cè)函數(shù)*/intvaild_student_name<char*p>; /*聲明驗(yàn)證用戶名函數(shù)*/intvaild_student_password<char*p>; /*聲明驗(yàn)證密碼函數(shù)*/intvaild_teacher_name<char*p>; /*聲明驗(yàn)證用戶名函數(shù)*/intvaild_teacher_password<char*p>; /*聲明驗(yàn)證密碼函數(shù)*/intvaild_two_password<char*p1,char*p2>; /*聲明驗(yàn)證兩次密碼是否相同函數(shù)*/intyes_no_return<>; /*聲明選擇是否返回上一層函數(shù)*/voidload<>; /*聲明加載函數(shù)*/voidregister_<int*count1,int*count2>; /*聲明注冊(cè)函數(shù)*/voiddisplay_student<structstudentstu>; /*聲明顯示學(xué)生信息函數(shù)*/voiddisplay_teacher<structteachertea>; /*聲明顯示老師信息函數(shù)*/voidstudent_file1<>; /*將保存的學(xué)生的賬號(hào)密碼存入文件中*/voidstudent_file2<>; /*將保存的學(xué)生的個(gè)人信息存入文件中*/voidstudent_file3<>; /*將保存的學(xué)生的成績(jī)存入文件中*/voidteacher_file<>; /*將保存的老師的賬號(hào)密碼存入文件中*/voidinput_information<intcount>;/*聲明輸入學(xué)生信息函數(shù)*/voidinput_score_menu<intcount>; /*聲明輸入學(xué)生成績(jī)函數(shù)*/voidcolor<>; /*聲明選擇窗體顏色函數(shù)*/voidprint_stu_information<intcount_stu>; /*聲明輸出賬號(hào)為num的學(xué)生的信息函數(shù)*/voidprint_stu_score<intcount_stu>; /*聲明輸出賬號(hào)為num的學(xué)生的成績(jī)函數(shù)*/voidshow_menu<>; /*聲明初始化界面函數(shù)*/voidinput<>; /*聲明輸入函數(shù)*/voidmenu1<>; /*聲明教師錄入課程表主菜單函數(shù)*/voidmenu2<>; /*聲明學(xué)生查詢課程表主菜單函數(shù)*/voidrank<>; /*聲明顯示時(shí)間順序函數(shù)*/voidquerymenu3<>; /*聲明查詢函數(shù)*/voidlooktime<>; /*聲明按照時(shí)間查詢函數(shù)*/voidlooklessonname<>; /*聲明按照課程名查詢函數(shù)*/voidadd<>; /*聲明保存函數(shù)*/voidamend<>; /*聲明修改課程函數(shù)*/voidamend1<>; /*聲明修改課程子函數(shù)*/voidamendnews<inti>; /*聲明修改整個(gè)課程信息函數(shù)*/voidamendtime<inti>; /*聲明修改課程時(shí)間函數(shù)*/voidamendlessonname<inti>; /*聲明修改課程課程名函數(shù)*/voidamendclassroom<inti>; /*聲明修改課程教室函數(shù)*/voiddeleted<>; /*聲明刪除函數(shù)*/voidadd_score<intcount>; /*聲明添加學(xué)生成績(jī)函數(shù)*/voidxiugai_score<intcount>; /*聲明修改學(xué)生成績(jī)函數(shù)*/voidshanchu_score<intcount>; /*聲明刪除學(xué)生成績(jī)函數(shù)*/voidchaxun_score<intcount>; /*聲明按要求查詢學(xué)生成績(jī)函數(shù)*/voidpaixu_score<intcount>; /*聲明學(xué)生成績(jī)排序函數(shù)*/voidtongji_score<intcount>; /*聲明學(xué)生成績(jī)統(tǒng)計(jì)函數(shù)*/floatchinese<intcount>; /*聲明計(jì)算語(yǔ)文成績(jī)最大值函數(shù)*/intchr<intcount>; /*聲明計(jì)算語(yǔ)文成績(jī)及格人數(shù)的函數(shù)*/floatenglish<intcount>; /*聲明計(jì)算英語(yǔ)成績(jī)最大值函數(shù)*/intehr<intcount>; /*聲明計(jì)算英語(yǔ)成績(jī)及格人數(shù)的函數(shù)*/floatmath<intcount>; /*聲明計(jì)算數(shù)學(xué)成績(jī)最大值函數(shù)*/intmhr<intcount>; /*聲明計(jì)算數(shù)學(xué)成績(jī)及格人數(shù)的函數(shù)*/floatcomputer<intcount>; /*聲明計(jì)算計(jì)算機(jī)成績(jī)最大值函數(shù)*/intthr<intcount>; /*聲明計(jì)算計(jì)算機(jī)成績(jī)及格人數(shù)的函數(shù)*/floatPE<intcount>; /*聲明計(jì)算體育成績(jī)最大值函數(shù)*/intphr<intcount>; /*聲明計(jì)算體育成績(jī)及格人數(shù)的函數(shù)*/floatsum_score<intcount>; /*聲明計(jì)算總分成績(jī)最大值函數(shù)*/voidload_student<inta>; /*聲明啟動(dòng)學(xué)生函數(shù)*/voidload_teacher<inta>; /*聲明啟動(dòng)老師函數(shù)*/structstudent /*學(xué)生結(jié)構(gòu)體*/{ /*個(gè)人信息*/ intstudent_id; /*賬號(hào)*/ charstudent_name[20];/*姓名*/ charpassword[16]; /*密碼*/ intage; /*年齡*/ charqq[12]; /*QQ號(hào)*/ chartel[12]; /*電話*/ intgrade; /*年級(jí)*/ /*各科成績(jī)*/ floatchinese; /*語(yǔ)文分?jǐn)?shù)*/ floatenglish; /*英語(yǔ)分?jǐn)?shù)*/ floatmath; /*數(shù)學(xué)分?jǐn)?shù)*/ floatcomputer; /*計(jì)算機(jī)分?jǐn)?shù)*/ floatPE; /*體育分?jǐn)?shù)*/ floatsum; /*總分*/ /*課程表*/ chartime[10];/*時(shí)間*/ charlessonname[20];/*課程名*/ charteacher[20];/*授課老師*/ charclassroom[10];/*教室*/charhours[10];/*第幾節(jié)課*/ intweeks;/*周時(shí)*/};structteacher /*老師結(jié)構(gòu)體*/{ intteacher_id; /*賬號(hào)*/ charteacher_name[20]; /*姓名*/ charpassword[16]; /*密碼*/};structstudentour_student[student_num];structteacherour_teacher[teacher_num];voidmain<> /*主函數(shù)*/{ system<"colorf0">; /*初始化背景顏色*/ show_menu<>; /*制作人信息簡(jiǎn)介*/ load<>;}voidload<> /*啟動(dòng)函數(shù)*/{ intflag=1; /*控制循環(huán)結(jié)束的變量*/ inta=0,b=0; /*記錄已注冊(cè)的學(xué)生的人數(shù)a為學(xué)生個(gè)數(shù)b為老師個(gè)數(shù)*/ int*count1=&a,*count2=&b; /*指向?qū)W生人數(shù)和老師人數(shù)的指針*/ intcorrect_student,correct_teacher; color<>; register_<count1,count2>; /*注冊(cè)學(xué)生和老師的帳號(hào)*/ student_file1<>; teacher_file<>; while<flag> { switch<show_menu_login<>>/*顯示登錄菜單*/ { case1:/*選擇1,進(jìn)入學(xué)生登錄*/ if<correct_student=is_my_student<our_student,count1>> { printf<"\n ◆學(xué)生登錄成功!\n">; display_student<our_student[correct_student-1]>; printf<"\n">; printf<" ">; system<"pause">; load_student<a>; } else printf<"\n登錄失??!\n">; printf<"\n">; printf<" 提示:按Y退出登錄界面,按N返回登錄界面!!!\n">; flag=yes_no_return<>; system<"cls">; break; case2:/*選擇2,進(jìn)入老師登錄,即管理員登錄*/ if<correct_teacher=is_my_teacher<our_teacher,count2>> { printf<"\n ◆管理員登錄成功!\n">; display_teacher<our_teacher[correct_teacher-1]>; printf<"\n">; printf<" ">; system<"pause">; load_teacher<a>; } else printf<"\n登錄失??!\n">; printf<"\n">; printf<" 提示:按Y退出登錄界面,按N返回登錄界面!!!\n">; flag=yes_no_return<>; system<"cls">; break; case3:/*選擇3,退出登錄*/ system<"cls">; flag=0; break; default: printf<"請(qǐng)正確輸入1-3:">; system<"cls">; } } }voidload_student<inta> /*啟動(dòng)學(xué)生函數(shù)*/{ intflag=1; system<"cls">; while<flag> { switch<show_student_select<>> { case1: /*選擇1,學(xué)生信息查詢*/ system<"cls">; print_stu_information<a>; printf<"\n">; printf<" 提示:按Y退出學(xué)生查詢界面,按N返回學(xué)生查詢界面!!!\n">; flag=yes_no_return<>; system<"cls">; break; case2: /*選擇2,學(xué)生成績(jī)查詢*/ system<"cls">; print_stu_score<a>; printf<"\n">; printf<" 提示:按Y退出學(xué)生查詢界面,按N返回學(xué)生查詢界面!!!\n">; flag=yes_no_return<>; system<"cls">; break; case3: /*選擇3,學(xué)生課表查詢*/ menu2<>; printf<" 提示:按Y退出學(xué)生查詢界面,按N返回學(xué)生查詢界面!!!\n">; flag=yes_no_return<>; system<"cls">; break; case4: /*選擇4,退出查詢界面*/ system<"cls">; flag=0; break; default: printf<"請(qǐng)正確輸入1-4:">; system<"cls">; } }}voidload_teacher<inta> /*啟動(dòng)老師函數(shù)*/{ intflag=1; system<"cls">; while<flag> { switch<show_teacher_select<>> { case1: /*選擇1,學(xué)生信息錄入*/ input_information<a>; system<"cls">; student_file2<>; printf<"\n 提示:按Y退出教師錄入界面,按N返回教師錄入界面!!!\n">; flag=yes_no_return<>; system<"cls">; break; case2: /*選擇2,學(xué)生成績(jī)錄入*/ input_score_menu<a>; system<"cls">; student_file3<>; printf<"\n 提示:按Y退出教師錄入界面,按N返回教師錄入界面!!!\n">; flag=yes_no_return<>; system<"cls">; break; case3: /*選擇3,學(xué)生課表錄入*/ menu1<>; printf<" 提示:按Y退出教師錄入界面,按N返回教師錄入界面!!!\n">; flag=yes_no_return<>; system<"cls">; break; case4: /*選擇4,退出管理界面*/ system<"cls">; flag=0; break; default: printf<"請(qǐng)正確輸入1-4:">; system<"cls">; } }}intlength_student_name<char*p> /*驗(yàn)證用戶名是否合法*/{ intl; l=strlen<p>; if<l>20||l<1> return0; else return1;}intvaild_student_name<char*p> /*判斷用戶名是否有效*/{ inti=0; intlen=strlen<p>; if<<*p>='a'&&*p<='z'>||<*p>='A'&&*p<='Z'>> /*判斷首字母是不是字母*/ { for<i=0;i<len;i++> { if<!<p[i]='_'||<p[i]>='a'&&p[i]<='z'>||<p[i]>='A'&&p[i]<='Z'>||<p[i]>='0'&&p[i]<='9'>>> /*判斷后面的字符是否有效*/ return0; } return1; } else return0;}intlength_student_password<char*p> /*密碼長(zhǎng)度有效性驗(yàn)證*/{ intlen; len=strlen<p>; if<len<6||len>16> return0; else return1;}intvaild_student_password<char*p> /*密碼的有效性驗(yàn)證*/{ inti=0; for<;*p!='\0';p++> { if<!<<*p>='a'&&*p<='z'>||<*p>'A'&&*p<'Z'>||<*p>='0'&&*p<='9'>>> return0; } return1;}intvaild_two_password<char*p1,char*p2> /*驗(yàn)證兩次密碼是否相同*/{ if<strcmp<p1,p2>==0> return1; else return0;}intstudent_register<structstudent*ptr_student,int*size> /*完成注冊(cè)功能*/{ charpassword[16]; charrepassword[16]; if<*size==student_num> { puts<" ◆注冊(cè)人數(shù)已滿!">; printf<"\n">; return0; } system<"cls">; printf<"\n\n">; printf<" ★請(qǐng)輸入注冊(cè)學(xué)生姓名:">; fflush<stdin>; gets<ptr_student[*size].student_name>; if<!<length_student_name<ptr_student[*size].student_name>&&vaild_student_name<ptr_student[*size].student_name>>> { printf<" ◆您輸入的姓名無(wú)效,學(xué)生姓名在1-20之間,首字符為字母,后面必須為字母、數(shù)字或下劃線!?。?>; return0; } printf<"\n">; printf<" ★請(qǐng)輸入注冊(cè)密碼:">; fflush<stdin>; gets<password>; printf<"\n">; printf<" ★請(qǐng)?jiān)俅屋斎胱?cè)密碼:">; fflush<stdin>; gets<repassword>; printf<"\n">; if<!vaild_two_password<password,repassword>> { printf<"\n №:兩次輸入的密碼不一致!!!">; printf<"\n">; return0; } else strcpy<ptr_student[*size].password,password>; if<!<length_student_password<ptr_student[*size].password>&&vaild_student_password<ptr_student[*size].password>>> { printf<" ◆您輸入的密碼無(wú)效,密碼應(yīng)在6-16位之間,密碼只能包含字母和數(shù)字!!!">; printf<"\n">; return0; } printf<" ★您的編號(hào)為:%d,這將是您的登錄賬號(hào)!!!",ptr_student[*size].student_id=20150000+*size>; return1;}intis_my_student<structstudent*p,int*size> /*如果登錄成功則返回第i+1個(gè)學(xué)生的信息,否則返回0*/{ inti; intzhanghao; charmima[18]; system<"cls">; printf<"\n\n">; printf<" ★請(qǐng)輸入您的賬號(hào):">; scanf<"%d",&zhanghao>; fflush<stdin>; printf<"\n">; printf<" ★請(qǐng)輸入您的密碼:">; gets<mima>; for<i=0;i<*size;i++> { if<<zhanghao==p[i].student_id>&&<strcmp<mima,p[i].password>==0>> returni+1; } return0;}voiddisplay_student<structstudentstu> /*顯示學(xué)生信息*/{ printf<"\n ★您的賬號(hào)是:%d\n",stu.student_id>;}intlength_teacher_name<char*p> /*驗(yàn)證用戶名是否合法*/{ intl; l=strlen<p>; if<l>20||l<1> return0; else return1;}intvaild_teacher_name<char*p> /*判斷用戶名是否有效*/{ inti=0; intlen=strlen<p>; if<<*p>='a'&&*p<='z'>||<*p>='A'&&*p<='Z'>> /*判斷首字母是不是字母*/ { for<i=0;i<len;i++> { if<!<p[i]='_'||<p[i]>='a'&&p[i]<='z'>||<p[i]>='A'&&p[i]<='Z'>||<p[i]>='0'&&p[i]<='9'>>> /*判斷后面的字符是否有效*/ return0; } return1; } else return0;}intlength_teacher_password<char*p> /*密碼長(zhǎng)度有效性驗(yàn)證*/{ intlen; len=strlen<p>; if<len<6||len>16> return0; else return1;}intvaild_teacher_password<char*p> /*密碼的有效性驗(yàn)證*/{ inti=0; for<;*p!='\0';p++> { if<!<<*p>='a'&&*p<='z'>||<*p>'A'&&*p<'Z'>||<*p>='0'&&*p<='9'>>> return0; } return1;}intteacher_register<structteacher*ptr_teacher,int*size> /*完成注冊(cè)功能*/{ charpassword[16]; charrepassword[16]; if<*size==teacher_num> { puts<" ◆注冊(cè)人數(shù)已滿!">; printf<"\n">; return0; } system<"cls">; printf<"\n\n">; printf<" ★請(qǐng)輸入注冊(cè)教師姓名:">; fflush<stdin>; gets<ptr_teacher[*size].teacher_name>; if<!<length_teacher_name<ptr_teacher[*size].teacher_name>&&vaild_teacher_name<ptr_teacher[*size].teacher_name>>> { printf<" ◆您輸入的姓名無(wú)效,教師姓名在1-20之間,首字符為字母,后面必須為字母、數(shù)字或下劃線?。?!">; printf<"\n">; return0; } printf<"\n">; printf<" ★請(qǐng)輸入注冊(cè)密碼:">; fflush<stdin>; gets<password>; printf<"\n">; printf<" ★請(qǐng)?jiān)俅屋斎胱?cè)密碼:">; fflush<stdin>; gets<repassword>; printf<"\n">; if<!vaild_two_password<password,repassword>> { printf<"\n №:兩次輸入的密碼不一致!!!">; printf<"\n">; return0; } else strcpy<ptr_teacher[*size].password,password>; if<!<length_teacher_password<ptr_teacher[*size].password>&&vaild_teacher_password<ptr_teacher[*size].password>>> { printf<" ◆您輸入的密碼無(wú)效,密碼應(yīng)在6-16位之間,密碼只能包含字母和數(shù)字?。。?>; printf<"\n">; return0; } printf<" ★您的編號(hào)為:%d,這將是您的登錄賬號(hào)。",ptr_teacher[*size].teacher_id=20150+*size>; return1;}intis_my_teacher<structteacher*p,int*size> /*如果登錄成功則返回第i+1個(gè)老師的信息,否則返回0*/{ inti; intzhanghao; charmima[18]; system<"cls">; printf<"\n\n">; printf<" ★請(qǐng)輸入您的賬號(hào):">; scanf<"%d",&zhanghao>; fflush<stdin>; printf<"\n">; printf<" ★請(qǐng)輸入您的密碼:">; gets<mima>; for<i=0;i<*size;i++> { if<<zhanghao==p[i].teacher_id>&&<strcmp<mima,p[i].password>==0>> returni+1; } return0;}voiddisplay_teacher<structteachertea> /*顯示老師信息*/{ printf<"\n ★您的賬號(hào)是:%d\n",tea.teacher_id>;}voidregister_<int*count1,int*count2> /*注冊(cè)函數(shù)*/{ inti=1; while<i> { switch<show_menu_register<>> { case1: if<student_register<our_student,count1>> { <*count1>++; printf<"\n">; printf<"\n ★注冊(cè)成功!\n">; printf<"">; system<"pause">; system<"cls">; } break; case2: if<teacher_register<our_teacher,count2>> { <*count2>++; printf<"\n">; printf<"\n ★注冊(cè)成功!\n">; printf<"">; system<"pause">; system<"cls">; } break; case3: i=0; system<"cls">; break; default: printf<"請(qǐng)正確輸入:\n">; printf<"">; system<"pause">; system<"cls">; } }}voidinput_information<intcount>{ intk; system<"cls">; for<k=0;k<count;k++> { printf<"\n\n">; printf<"\t請(qǐng)輸入第%d位同學(xué)的信息\n",k+1>; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的年齡:",our_student[k].student_id>; scanf<"%d",&our_student[k].age>; printf<"\n">; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的QQ號(hào):",our_student[k].student_id>; scanf<"%s",our_student[k].qq>; printf<"\n">; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的電話:",our_student[k].student_id>; scanf<"%s",our_student[k].tel>; printf<"\n">; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的年級(jí):",our_student[k].student_id>; scanf<"%d",&our_student[k].grade>; printf<"\n">; printf<"\t\t您已經(jīng)成功將學(xué)號(hào)為%d的學(xué)生的信息錄入!!!\n",our_student[k].student_id>; }}voidinput_score_menu<intcount>{ intnumber,i=1; system<"cls">; printf<"\n\n">; printf<"\t*************************學(xué)生成績(jī)管理*************************\n">; printf<"\t**\n">; printf<"\t*1.☆添加學(xué)生成績(jī)☆*\n">; printf<"\t*2.☆修改學(xué)生成績(jī)☆*\n">; printf<"\t*3.☆刪除學(xué)生成績(jī)☆*\n">; printf<"\t*4.☆按要求查詢學(xué)生成績(jī)☆*\n">; printf<"\t*5.☆按要求排序☆*\n">; printf<"\t*6.☆按要求統(tǒng)計(jì)成績(jī)☆*\n">; printf<"\t*7.☆退出學(xué)生成績(jī)管理☆*\n">; printf<"\t**\n">; printf<"\t******************請(qǐng)輸入選擇的功能編號(hào)<1-7>:******************\n">; printf<"\t請(qǐng)輸入:">; scanf<"%d",&number>; fflush<stdin>; while<i> { switch<number> { case1: add_score<count>; /*添加學(xué)生成績(jī)函數(shù)*/ printf<" 提示:按Y退出學(xué)生成績(jī)管理界面,按N重新錄入學(xué)生成績(jī)!!!\n">; i=yes_no_return<>; system<"cls">; break; case2: xiugai_score<count>; /*修改學(xué)生成績(jī)函數(shù)*/ printf<" 提示:按Y退出學(xué)生成績(jī)錄入界面,按N重新修改學(xué)生成績(jī)!!!\n">; i=yes_no_return<>; system<"cls">; break; case3: shanchu_score<count>; /*刪除學(xué)生成績(jī)函數(shù)*/ printf<" ">; system<"pause">; system<"cls">; break; case4: chaxun_score<count>; /*按要求查詢學(xué)生成績(jī)函數(shù)*/ printf<" 提示:按Y退出學(xué)生成績(jī)管理界面,按N返回學(xué)生成績(jī)管理界面!!!\n">; i=yes_no_return<>; system<"cls">; break; case5: paixu_score<count>; /*學(xué)生成績(jī)排序函數(shù)*/ printf<" 提示:按Y退出學(xué)生成績(jī)管理界面,按N返回學(xué)生成績(jī)管理界面!!!\n">; i=yes_no_return<>; system<"cls">; break; case6: tongji_score<count>; /*學(xué)生成績(jī)統(tǒng)計(jì)函數(shù)*/ printf<" 提示:按Y退出學(xué)生成績(jī)管理界面,按N返回學(xué)生成績(jī)管理界面!!!\n">; i=yes_no_return<>; system<"cls">; break; case7: system<"cls">; break; default: printf<"請(qǐng)正確輸入1-7:">; system<"cls">; } }}voidadd_score<intcount> /*添加學(xué)生成績(jī)函數(shù)*/{ system<"cls">; intk; for<k=0;k<count;k++> { printf<"\n\n">; printf<"\t請(qǐng)輸入第%d位同學(xué)的各科成績(jī):\n",k+1>; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的語(yǔ)文分?jǐn)?shù):",our_student[k].student_id>; scanf<"%f",&our_student[k].chinese>; printf<"\n">; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的英語(yǔ)分?jǐn)?shù):",our_student[k].student_id>; scanf<"%f",&our_student[k].english>; printf<"\n">; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的計(jì)算機(jī)分?jǐn)?shù):",our_student[k].student_id>; scanf<"%f",&our_student[k].computer>; printf<"\n">; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的數(shù)學(xué)分?jǐn)?shù):",our_student[k].student_id>; scanf<"%f",&our_student[k].math>; printf<"\n">; printf<"\t\t請(qǐng)錄入學(xué)號(hào)為%d的學(xué)生的體育分?jǐn)?shù):",our_student[k].student_id>; scanf<"%f",&our_student[k].PE>; our_student[k].sum=our_student[k].chinese+our_student[k].english+our_student[k].computer+our_student[k].math+our_student[k].PE; }}voidxiugai_score<intcount> /*修改學(xué)生成績(jī)函數(shù)*/{ intnumber,i; system<"cls">; printf<"\n\n">; printf<" ☆請(qǐng)輸入需要修改成績(jī)的學(xué)生的學(xué)號(hào):">; scanf<"%d",&number>; printf<"\n">; while<1> { if<<number>=20150000>&&<number<=count>> { printf<" ☆您輸入的學(xué)號(hào)正確!可以進(jìn)行修改處理。\n\n">; break; } else { printf<" ☆您輸入的學(xué)號(hào)有問(wèn)題,請(qǐng)重新輸入要修改成績(jī)的學(xué)號(hào)!!!\n\n">; printf<" ☆請(qǐng)輸入需要修改成績(jī)的學(xué)生的學(xué)號(hào):">; scanf<"%d",&number>; } } fflush<stdin>; for<i=0;our_student[i].student_id==number;i++> { printf<"\n請(qǐng)輸入需要修改的語(yǔ)文成績(jī):">; scanf<"%f",&our_student[i].chinese>; printf<"\n請(qǐng)輸入需要修改的英語(yǔ)成績(jī):">; scanf<"%f",&our_student[i].english>; printf<"\n請(qǐng)輸入需要修改的數(shù)學(xué)成績(jī):">; scanf<"%f",&our_student[i].math>; printf<"\n請(qǐng)輸入需要修改的計(jì)算機(jī)成績(jī):">; scanf<"%f",&our_student[i].computer>; printf<"\n請(qǐng)輸入需要修改的體育成績(jī):">; scanf<"%f",&our_student[i].PE>; our_student[i].sum=our_student[i].chinese+our_student[i].english+our_student[i].computer+our_student[i].math+our_student[i].PE; break; }}voidshanchu_score<intcount> /*刪除學(xué)生成績(jī)函數(shù)*/{ intnumber,i; system<"cls">; printf<"請(qǐng)輸入需要?jiǎng)h除成績(jī)的學(xué)生的學(xué)號(hào):">; scanf<"%d",&number>; while<1> { if<number>=20150000&&number<=count> { printf<"您輸入的學(xué)號(hào)正確!可以進(jìn)行修改處理。\n">; break; } else { printf<"您輸入的學(xué)號(hào)有問(wèn)題,請(qǐng)重新輸入要修改成績(jī)的學(xué)號(hào)?。?!\n">; printf<"請(qǐng)輸入需要修改成績(jī)的學(xué)生的學(xué)號(hào):">; scanf<"%d",&number>; } } printf<"您確定要將學(xué)號(hào)為%d的學(xué)生的成績(jī)刪除!!!\n",number>; printf<"1.是2.否\n">; scanf<"%d",&i>; switch<i> { case1: for<i=0;our_student[i].student_id==number;i++> { our_student[i].chinese=0; our_student[i].english=0; our_student[i].math=0; our_student[i].computer=0; our_student[i].PE=0; our_student[i].sum=0; printf<"\n">; printf<"您已將學(xué)號(hào)為%d的學(xué)生的成績(jī)刪除!!!\n",number>; printf<"****************************************\n">; printf<"*姓名:%s*\n",our_student[i].student_name>; printf<"*學(xué)號(hào):%d*\n",our_student[i].student_id>; printf<"*年級(jí):%d*\n",our_student[i].grade>; printf<"*語(yǔ)文成績(jī):%f*\n",our_student[i].chinese>; printf<"*英語(yǔ)成績(jī):%f*\n",our_student[i].english>; printf<"*數(shù)學(xué)成績(jī):%f*\n",our_student[i].math>; printf<"*計(jì)算機(jī)成績(jī):%f*\n",our_student[i].computer>; printf<"*體育成績(jī):%f*\n",our_student[i].PE>; printf<"*總分:%f*\n",our_student[i].sum>; printf<"****************************************\n">; break; } break; case2: break; default: break; }}voidchaxun_score<intcount> /*按要求查詢學(xué)生成績(jī)函數(shù)*/{ intnumber,i; system<"cls">; printf<"請(qǐng)輸入需要查詢的學(xué)生的學(xué)號(hào):">; scanf<"%d",&number>; while<1> { if<number>=20150000&&number<=count> { printf<"您輸入的學(xué)號(hào)正確!可以進(jìn)行修改處理。\n">; break; } else { printf<"您輸入的學(xué)號(hào)有問(wèn)題,請(qǐng)重新輸入要查詢成績(jī)的學(xué)號(hào)?。。n">; printf<"請(qǐng)輸入需要查詢成績(jī)的學(xué)生的學(xué)號(hào):">; scanf<"%d",&number>; } } for<i=0;our_student[i].student_id==number;i++> { printf<"****************************************\n">; printf<"*姓名:%s*\n",our_student[i].student_name>; printf<"*學(xué)號(hào):%d*\n",our_student[i].student_id>; printf<"*年級(jí):%d*\n",our_student[i].grade>; printf<"*語(yǔ)文成績(jī):%f*\n",our_student[i].chinese>; printf<"*英語(yǔ)成績(jī):%f*\n",our_student[i].english>; printf<"*數(shù)學(xué)成績(jī):%f*\n",our_student[i].math>; printf<"*計(jì)算機(jī)成績(jī):%f*\n",our_student[i].computer>; printf<"*體育成績(jī):%f*\n",our_student[i].PE>; printf<"*總分:%f*\n",our_student[i].sum>; printf<"****************************************\n">; }}voidpaixu_score<intcount> /*學(xué)生成績(jī)排序函數(shù)*/{}voidtongji_score<intcount> /*學(xué)生成績(jī)統(tǒng)計(jì)函數(shù)*/{ system<"cls">; inti; printf<"**********************************************\n">; printf<"* 1.語(yǔ)文最高分*\n">; printf<"* 2.語(yǔ)文及格的人數(shù)*\n">; printf<"* 3.語(yǔ)文及格率*\n">; printf<"* 4.英語(yǔ)最高分*\n">; printf<"* 5.英語(yǔ)及格的人數(shù)*\n">; printf<"* 6.英語(yǔ)及格率*\n">; printf<"* 7.數(shù)學(xué)最高分*\n">; printf<"* 8.數(shù)學(xué)及格人數(shù)*\n">; printf<"* 9.數(shù)學(xué)及格率*\n">; printf<"* 10.計(jì)算機(jī)最高分*\n">; printf<"* 11.計(jì)算機(jī)及格的人數(shù)*\n">; printf<"* 12.計(jì)算機(jī)及格率*\n">; printf<"* 13.體育最高分*\n">; printf<"* 14.體育及格人數(shù)*\n">; printf<"* 15.體育及格率*\n">; printf<"*16.總成績(jī)最高*\n">; printf<"**********************************************\n">; printf<"請(qǐng)選擇統(tǒng)計(jì)條件:">; scanf<"%d",&i>; fflush<stdin>; if<i==1> { floata; a=chinese<count>; printf<"語(yǔ)文最高分為:%.2f",a>; } elseif<i==2> { intb; b=chr<count>; printf<"語(yǔ)文及格的人數(shù)為:%d",b>; } elseif<i==3> { intc; c=chr<count>; printf<"語(yǔ)文的及格率為:%.2f",float<c>/count>; } elseif<i==4> { floata; a=math<count>; printf<"數(shù)學(xué)最高分為:%.2f",a>; } elseif<i==5> { intb; b=mhr<count>; printf<"數(shù)學(xué)及格的人數(shù)為:%d",b>; } elseif<i==6> { intc; c=mhr<count>; printf<"數(shù)學(xué)的及格率為:%.2f",float<c>/count>; } elseif<i==7> { floata; a=english<count>; printf<"英語(yǔ)最高分為:%.2f",a>; } elseif<i==8> { intb; b=ehr<count>; printf<"英語(yǔ)及格的人數(shù)為:%d",b>; } elseif<i==9> { intc; c=ehr<count>; printf<"英語(yǔ)的及格率為:%.2f",float<c>/count>; } elseif<i==10> { floata; a=computer<count>; printf<"計(jì)算機(jī)最高分為:%.2f",a>; } elseif<i==11> { intb; b=thr<count>; printf<"計(jì)算機(jī)及格的人數(shù)為:%d",b>; } elseif<i==12> { intc; c=thr<count>; printf<"計(jì)算機(jī)的及格率為:%.2f",float<c>/count>; } elseif<i==13> { floata; a=PE<count>; printf<"體育最高分為:%.2f",a>; } elseif<i==14> { intb; b=phr<count>; printf<"體育及格的人數(shù)為:%d",b>; } elseif<i==15> { intc; c=phr<count>; printf<"體育的及格率為:%.2f",float<c>/count>; } elseif<i==16> { floata; a=sum_score<count>; printf<"總分最高為:%.2f",a>; } else { printf<"輸入錯(cuò)誤?。?!\n">; }}floatchinese<intcount> /*計(jì)算語(yǔ)文成績(jī)最大值函數(shù)*/{ floatmax; inti; max=our_student[0].chinese; for<i=0;i<count;i++> { if<max<our_student[i].chinese> { max=our_student[i].chinese; } } returnmax;}intchr<intcount> /*計(jì)算語(yǔ)文成績(jī)及格人數(shù)的函數(shù)*/{ inti,a=0; for<i=0;i<count;i++> { if<our_student[i].chinese>=60> { a++; } } returna;}floatenglish<intcount> /*計(jì)算英語(yǔ)成績(jī)最大值函數(shù)*/{ floatmax; inti; max=our_student[0].english; for<i=0;i<count;i++> { if<max<our_student[i].english> { max=our_student[i].english; } } returnmax;}intehr<intcount> /*計(jì)算英語(yǔ)成績(jī)及格人數(shù)的函數(shù)*/{ inti,a=0; for<i=0;i<count;i++> { if<our_student[i].english>=60> { a++; } } returna;}floatmath<intcount> /*計(jì)算數(shù)學(xué)成績(jī)最大值函數(shù)*/{ floatmax; inti; max=our_student[0].math; for<i=0;i<count;i++> { if<max<our_student[i].math> { max=our_student[i].math; } } returnmax;}intmhr<intcount> /*計(jì)算數(shù)學(xué)成績(jī)及格人數(shù)的函數(shù)*/{ inti,a=0; for<i=0;i<count;i++> { if<our_student[i].math>=60> { a++; } } returna;}floatcomputer<intcount> /*計(jì)算計(jì)算機(jī)成績(jī)最大值函數(shù)*/{ floatmax; inti; max=our_student[0].computer; for<i=0;i<count;i++> { if<max<our_student[i].computer> { max=our_student[i].computer; } } returnmax;}intthr<intcount> /*計(jì)算計(jì)算機(jī)成績(jī)及格人數(shù)的函數(shù)*/{ inti,a=0; for<i=0;i<count;i++> { if<our_student[i].computer>=60> { a++; } } returna;}floatPE<intcount> /*計(jì)算體育成績(jī)最大值函數(shù)*/{ floatmax; inti; max=our_student[0].PE; for<i=0;i<count;i++> { if<max<our_student[i].PE> { max=our_student[i].PE; } } returnmax;}intphr<intcount> /*計(jì)算體育成績(jī)及格人數(shù)的函數(shù)*/{ inti,a=0; for<i=0;i<count;i++> { if<our_student[i].PE>=60> { a++; } } returna;}floatsum_score<intcount> /*計(jì)算總分成績(jī)最大值函數(shù)*/{ floatmax; inti; max=our_student[0].sum; for<i=0;i<count;i++> { if<max<our_student[i].sum> { max=our_student[i].sum; } } returnmax;}intyes_no_return<>/*選擇是否返回上一層*/{ charjude; printf<"\n 請(qǐng)輸入:">; fflush<stdin>; scanf<"%c",&jude>; if<'Y'==jude> return0; else return1;}voidstudent_file1<> /*將保存的學(xué)生的賬號(hào)密碼存入文件中*/{inti,a; FILE*fp1; fp1=fopen<"student1.txt","r">; if<fp1==NULL> { fp1=fopen<"student1.txt","w">; } else { fclose<fp1>; fp1=fopen<"student1.txt","a">; } printf<"======================正在將學(xué)生帳號(hào)密碼保存至文件======================\n">; printf<"\n 要添加的學(xué)生賬號(hào)的個(gè)數(shù)為:">; scanf<"%d",&a>; printf<"\n">; for<i=0;i<a;i++> { printf<" ***********************************\n">; printf<"\n 請(qǐng)輸入第%d個(gè)要添加的學(xué)生賬號(hào):",i+1>; scanf<"%d",&our_student[i].student_id>; printf<"\n 請(qǐng)輸入學(xué)生密碼:">; scanf<"%s",&our_student[i].password>; } for<i=0;i<a;i++> { fprintf<fp1,"%d",our_student[i].student_id>; fprintf<fp1,"%s",our_student[i].password>; } printf<" 添加成功!\n">; fclose<fp1>; printf<"\n ">; system<"pause">; system<"cls">;}voidstudent_file2<> /*將保存的學(xué)生的個(gè)人信息存入文件中*/{inti,a; FILE*fp1; fp1=fopen<"student2.txt","r">; if<fp1==NULL> { fp1=fopen<"student2.txt","w">; } else { fclose<fp1>; fp1=fopen<"student2.txt","a">; } printf<"======================正在將學(xué)生個(gè)人信息保存至文件======================\n">; printf<"\n 要添加的學(xué)生信息的個(gè)數(shù)為:">; scanf<"%d",&a>; printf<"\n">; for<i=0;i<a;i++> { fprintf<fp1,"%d",our_student[i].age>; fprintf<fp1,"%s",our_student[i].qq>; fprintf<fp1,"%s",our_student[i].tel>; fprintf<fp1,"%d",our_student[i].grade>; } printf<" 添加成功!\n">; fclose<fp1>; printf<"\n ">; system<"pause">; system<"cls">;}voidstudent_file3<> /*將保存的學(xué)生的成績(jī)存入文件中*/{inti,a; FILE*fp1; fp1=fopen<"student3.txt","r">; if<fp1==NULL> { fp1=fopen<"student3.txt","w">; } else { fclose<fp1>; fp1=fopen<"student3.txt","a">; } printf<"=======================正在將學(xué)生成績(jī)保存至文件=======================\n">; printf<"\n 要添加的學(xué)生成績(jī)的個(gè)數(shù)為:">; scanf<"%d",&a>; printf<"\n">; for<i=0;i<a;i++> { fprintf<fp1,"%f",our_student[i].chinese>; fprintf<fp1,"%f",our_student[i].english>; fprintf<fp1,"%f",our_student[i].math>; fprintf<fp1,"%f",our_student[i].computer>; fprintf<fp1,"%f",our_student[i].sum>; } printf<" 添加成功!\n">; fclose<fp1>; printf<"\n ">; system<"pause">; system<"cls">;}voidteacher_file<> /*將保存的老師的賬號(hào)密碼存入文件中*/{inti,a; FILE*fp1; fp1=fopen<"teacher.txt","r">; if<fp1==NULL> { fp1=fopen<"teacher.txt","w">; } else { fclose<fp1>; fp1=fopen<"teacher.txt","a">; } printf<"======================正在將學(xué)生帳號(hào)密碼保存至文件======================\n">; printf<"\n 要添加的老師賬號(hào)的個(gè)數(shù)為:">; scanf<"%d",&a>; printf<"\n">; for<i=0;i<a;i++> { printf<" ***********************************\n">; printf<"\n 請(qǐng)輸入第%d個(gè)要添加的老師賬號(hào):",i+1>; scanf<"%d",&our_teacher[i].teacher_id>; printf<"\n 請(qǐng)輸入老師密碼:">; scanf<"%s",&our_teacher[i].password>; } for<i=0;i<a;i++> { fprintf<fp1,"%d",our_teacher[i].teacher_id>; fprintf<fp1,"%s",our_teacher[i].password>; } fclose<fp1>; printf<"\n ">; system<"pause">; system<"cls">;}intshow_menu_register<> /*注冊(cè)菜單*/{ intchoice; printf<"==========================歡迎使用熊智誠(chéng)的教務(wù)系統(tǒng)==========================\n">; printf<"\n\n\n\n\n">; printf<"\t*********************教務(wù)管理系統(tǒng)注冊(cè)界面********************\n">; printf<"\t*************************************\n">; printf<"\t*************************\n">; printf<"\t*******1.學(xué)生注冊(cè)*******\n">; printf<"\t*********\n">; printf<"\t**2.管理員注冊(cè)**\n">; printf<"\t*********\n">; printf<"\t*******3.退出注冊(cè)*******\n">; printf<"\t**********
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 醫(yī)院靈活就業(yè)合同范例
- 敬業(yè)模特合同范例
- 油封供應(yīng)合同范例
- 租給酒店合同范例
- 加盟白茶合同范例
- 供水合同范例
- 羅定舊房買賣合同范例
- 廣告加工合作合同范例
- 壓縮氣管采購(gòu)合同范例
- 美甲門店轉(zhuǎn)讓合同范例
- 廣東省湛江市雷州市2023-2024學(xué)年四年級(jí)上學(xué)期語(yǔ)文期末試卷
- 面部設(shè)計(jì)美學(xué)培訓(xùn)
- 制冷原理與設(shè)備(上)知到智慧樹章節(jié)測(cè)試課后答案2024年秋煙臺(tái)大學(xué)
- 加工裝配業(yè)務(wù)合作框架協(xié)議
- 行政和解協(xié)議書樣本
- 2020年同等學(xué)力申碩《計(jì)算機(jī)科學(xué)與技術(shù)學(xué)科綜合水平考試》歷年真題及答案
- 公共體育(三)學(xué)習(xí)通超星期末考試答案章節(jié)答案2024年
- 期中 (試題) -2024-2025學(xué)年人教PEP版英語(yǔ)六年級(jí)上冊(cè)
- 2025蛇年元旦新年晚會(huì)蛇年獻(xiàn)歲模板
- 結(jié)核性腦膜炎護(hù)理查房課件
- 直播推廣合作合同:2024年主播專屬流量投放合同
評(píng)論
0/150
提交評(píng)論