
寻高手帮忙做个关于学生成绩管理系统的C语言程序! 20
设计任务编写一个对学生成绩进行管理的程序,能够实现学生成绩信息的录入、学生各科成绩的查询、学生成绩信息的删除、学生成绩信息的插入、学生成绩的统计等功能。程序要求编写登陆的...
设计任务
编写一个对学生成绩进行管理的程序,能够实现学生成绩信息的录入、学生各科成绩的查询、学生成绩信息的删除、学生成绩信息的插入、学生成绩的统计等功能。
程序要求编写登陆的功能选项界面。例如:
1--成绩录入
2--成绩查询
3--删除成绩
4--插入新的学生成绩信息
5--成绩统计
6--结束程序
各个选项分别代表不同的功能,并由此进入到不同功能模块中。要求,从不同的功能模块退出时要返回到这个功能界面。
选择1:以班级为单位完成学生信息的录入,要求数据要保存到文件中,供下次使用。
选择2:要求能够根据某种条件,例如,成绩、姓名、学号、课程编号完成查询功能。
选择3:要求根据学号,删除某个学生的成绩
选择4:要求能够插入某个学生的成绩信息
选择5:要求能够给出全班某门课程的最好分,平均分
选择6:结束应用程序
小弟是新手!积分只有25,我知道分太少!但希望好心人帮帮我!谢谢了! 展开
编写一个对学生成绩进行管理的程序,能够实现学生成绩信息的录入、学生各科成绩的查询、学生成绩信息的删除、学生成绩信息的插入、学生成绩的统计等功能。
程序要求编写登陆的功能选项界面。例如:
1--成绩录入
2--成绩查询
3--删除成绩
4--插入新的学生成绩信息
5--成绩统计
6--结束程序
各个选项分别代表不同的功能,并由此进入到不同功能模块中。要求,从不同的功能模块退出时要返回到这个功能界面。
选择1:以班级为单位完成学生信息的录入,要求数据要保存到文件中,供下次使用。
选择2:要求能够根据某种条件,例如,成绩、姓名、学号、课程编号完成查询功能。
选择3:要求根据学号,删除某个学生的成绩
选择4:要求能够插入某个学生的成绩信息
选择5:要求能够给出全班某门课程的最好分,平均分
选择6:结束应用程序
小弟是新手!积分只有25,我知道分太少!但希望好心人帮帮我!谢谢了! 展开
1个回答
展开全部
分是少了点,不过好心的我就帮帮你吧,呵呵!
你以上的功能我的程序里全有,你自己看看改改吧!
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#define InputRcd 1
#define UpdateRcd 2
#define SelectRcd 3
#define Exit 4
#define NAMELEN 16
#define CLASSLEN 6
struct record {
char classID[CLASSLEN];
int term;
char name[NAMELEN];
int chinese,math,english;
};
void showProgInform()
{
printf("-------------------------------------------------\n");
printf("| *** STUDENTS' SCORE PLATFORM *** |\n");;
printf("-------------------------------------------------\n\n");
}
void showMenu() {
system("cls");
showProgInform();
printf("Please select an operation fo the following MENU: \n");
printf(" 1. Input a record \n");
printf(" 2. Update a record\n");
printf(" 3. Select record(s)\n");
printf(" 4. Exit. \n");
}
void inputRecord() {
struct record inscr;
FILE * fp;
system("cls");
showProgInform();
printf("Mention: You are to add new record\n\n");
printf("Please input by the following instructions: \n");
printf("Class ID: ");
scanf("%s",inscr.classID);
printf("Term Number: ");
scanf("%d",&(inscr.term));
printf("Student Name: ");
scanf("%s",inscr.name);
printf("Chinese score: ");
scanf("%d",&(inscr.chinese));
printf("Math score: ");
scanf("%d",&(inscr.math));
printf("English Score: ");
scanf("%d",&(inscr.english));
getchar();
if((fp=(fopen("stu_score.rcd","ab+")))==NULL) {
printf("Input record failed!\n");
return;
}
fwrite(&inscr,sizeof(struct record),1,fp);
fclose(fp);
if((fp=fopen("stu_score.txt","ab+"))==NULL) {
return;
}
fprintf(fp,"%s-%d %s: %d %d %d\r\n",inscr.classID,inscr.term,inscr.name,inscr.chinese,inscr.math,inscr.english);;
fclose(fp);
}
void showSingleRecord(struct record rc) {
printf("%s-%d %s: (CHI)%d (MAT)%d (ENG)%d\n",rc.classID,rc.term,rc.name,rc.chinese,rc.math,rc.english);
}
void updateRecord()
{
long fsize,arraySize,i;
struct record *allRecords,newRcd;
int hasFound = 0;
FILE * fp;
FILE * txt;
system("cls");
showProgInform();
if((fp = fopen("stu_score.rcd","rb")) == NULL ) {
printf("! No records , cannot operate\n");
return;
}
printf("Mention: You are to update record\n\n");
printf("Please the record you want to update by the follow mention: \n");
printf("Class Id: ");
scanf("%s",newRcd.classID);
printf("Term number: ");
scanf("%d",&newRcd.term);
printf("Student name: ");
scanf("%s",newRcd.name);
fseek(fp,0,SEEK_END);
fsize = ftell(fp);
arraySize = fsize/(sizeof(struct record));
allRecords = (struct record *)calloc(arraySize,sizeof(struct record));
rewind(fp);
fread(allRecords,sizeof(struct record),arraySize,fp);
for(i=0;i<arraySize;i++) {
if(strcmp(newRcd.classID,allRecords[i].classID)==0 && newRcd.term==allRecords[i].term && strcmp(newRcd.name,allRecords[i].name)==0) {
printf("Find the matching record: ");
showSingleRecord(allRecords[i]);
printf("Input new Score: \n");
printf("New Chinese Score: ");
scanf("%d",&(allRecords[i].chinese));
printf("New Math Score: ");
scanf("%d",&(allRecords[i].math));
printf("New English Score: ");
scanf("%d",&(allRecords[i].english));
printf("After update ,the records is : \n\t");
showSingleRecord(allRecords[i]);
printf("\n");
hasFound = 1;
break;
}
}
fclose(fp);
if(!hasFound) {
printf("No matching record has found!\n");
free(allRecords);
return;
}
if((fp = fopen("stu_score.rcd","w"))==NULL) {
printf("Write file stu_score.rcd failed\n");
return;
}
if((txt = fopen("stu_score.txt","w"))==NULL) {
printf("Write file stu_score.txt failed\n");
return;
}
fwrite(allRecords,sizeof(struct record),arraySize,fp);
for(i=0;i<arraySize;i++) {
fprintf(txt,"%s-%d %s: %d %d %d\r\n",allRecords[i].classID,allRecords[i].term,allRecords[i].name,allRecords[i].chinese,allRecords[i].math,allRecords[i].english);
}
free(allRecords);
fclose(fp);
fclose(txt);
}
void showSelectMenu(char classID[],int term) {
system("cls");
showProgInform();
printf("Mention: All the following opertion based on classID: %s,Term: %d\n\n",classID,term);
printf("Mention: You are to select the records\n\n");
printf("\t Please choose an operation: \n");
printf("\t 1. Select all records of the classID.\n");
printf("\t 2. Sort by the average score.\n");
printf("\t 3. Select no passed record.\n");
printf("\tOther. Return the high level menu.\n\n");
}
void showStatistic(struct record *r ,long size,char classID[],int term) {
int total;
float ave;
long i;
system("cls");
showProgInform();
printf("All records for class: %s,term: %d; total record nubmer: %ld\n",classID,term,size);
printf("********************************************************\n");
for(i=0;i<size;i++) {
total = r[i].chinese+r[i].english +r[i].math ;
ave = (float)total/3;
printf(" %s: (CHI)%d (MAT)%d (ENG)%d (Total)%d (Ave)%.2f\r\n",r[i].name,r[i].chinese,r[i].math,r[i].english,total,ave);
}
printf("********************************************************\n\n");
printf("Press Enter to return Select submenu\n");
getchar();
}
void sortSelectByAve(struct record * r,long size) {
FILE *fp;
struct record temp;
float outerAve ,innerAve;
int total;
long i,j;
system("cls");
showProgInform();
printf("\nSorted the records by average score\n");
for(i=0;i<size;i++) {
outerAve = (float)(r[i].chinese+r[i].math+r[i].english)/3;
for(j=i+1;j<size;j++) {
innerAve = (float)(r[j].chinese+r[j].math+r[j].english)/3;
if(innerAve > outerAve) {
strcpy(temp.name,r[j].name);
temp.chinese = r[j].chinese;
temp.math = r[j].math ;
temp.english = r[j].english ;
strcpy(r[j].name,r[i].name);
r[j].chinese = r[i].chinese ;
r[j].math = r[i].math ;
r[j].english = r[i].english ;
strcpy(r[i].name,temp.name);
r[i].chinese = temp.chinese ;
r[i].math = temp.math ;
r[i].english = temp.english ;
}
}
}
printf("\nshow sorted records \n");
printf("********************************************\n");
for(i=0;i<size;i++) {
total = r[i].chinese + r[i].math + r[i].english ;
innerAve = (float)total/3;
printf("%s: %d %d %d %d %f\n",r[i].name,r[i].chinese,r[i].math,r[i].english,total,innerAve);
}
printf("********************************************\n");
printf("write sorted records to \"sorted.txt\"\n");
if((fp = fopen("sorted.txt","w"))== NULL) {
printf("open sort.txt failed\n");
return;
}
for(i=0;i<size;i++) {
total = r[i].chinese + r[i].math + r[i].english ;
innerAve = (float)total/3;
fprintf(fp,"(CLASS-TERM)%s-%d (NAME)%s: (CHI)%3d (MAT)%3d (ENG)%3d (TOTAL)%4d (AVERG)%.2f\r\n",r[i].classID,r[i].term,r[i].name,r[i].chinese,r[i].math,r[i].english,total,innerAve);
}
printf("write file sorted.txt finished\n");
fclose(fp);
printf("\nPress any key to return Select subMenu\n");
}
void noPass(struct record * r,int size) {
long i=0,j=0;
FILE * fp;
if((fp=fopen("no-pass.txt","w"))==NULL) {
printf("create no-pass.txt failed");
return;
}
system("cls");
showProgInform();
printf("Mention: The following operation will be all on the classId and term you input\n\n");
printf("\nShow student that one subject is no-pass\n");
printf("***********************************************\n");
for(i=0;i<size;i++) {
if(r[i].chinese <60 || r[i].math<60 || r[i].english <60) {
printf("%s-%d %s: ",r[i].classID,r[i].term,r[i].name);
fprintf(fp,"%s-%d %s: ",r[i].classID,r[i].term,r[i].name);
if(r[i].chinese < 60 ) {
printf("(Chinese)%d ",r[i].chinese);
fprintf(fp,"(Chinese)%d ",r[i].chinese );
}
if(r[i].math < 60) {
printf("(Math)%d ",r[i].math);
fprintf(fp,"(Math)%d ",r[i].math);
}
if(r[i].english < 60) {
printf("(English)%d",r[i].english);
fprintf(fp,"(English)%d",r[i].english);
}
printf("\r\n");
fprintf(fp,"\r\n");
}
}
printf("***********************************************\n");
fclose(fp);
printf("Press Enter to return \"Select\" submenu\n");
}
void selectRecord() {
char classID[CLASSLEN];
int term;
FILE * fp;
long fsize=0,arraySize=0,thisSize=0,i=0,j=0;
struct record *allRcd,*thisClass;
system("cls");
showProgInform();
printf("Mention: The following operation will be all on the classId and term you input\n\n");
printf("Mention: please operate by the following instructions\n\n");
printf("Input ClassID: ");
scanf("%s",classID);
printf("Input term number: ");
scanf("%d",&term);
if((fp=fopen("stu_score.rcd","r"))==NULL) {
printf("\nWarining: No record exists!\n");
return;
}
fseek(fp,0,SEEK_END);
fsize = ftell(fp);
arraySize = fsize/(sizeof(struct record));
allRcd = (struct record *)calloc(arraySize,sizeof(struct record));
rewind(fp);
fread(allRcd,sizeof(struct record),arraySize,fp);
printf("Press Enter to show the sub menu of Select menu\n");
for(i=0;i<arraySize;i++) {
if(strcmp(classID,allRcd[i].classID)==0 && term==allRcd[i].term) {
thisSize++;
}
}
if(thisSize==0) {
printf("\nWaring: No record for Class %s Term %d\n",classID,term);
fclose(fp);
free(allRcd);
return;
}
thisClass = (struct record *)calloc(thisSize,sizeof(struct record));
j=0;
for(i=0;i<arraySize;i++) {
if(strcmp(classID,allRcd[i].classID)==0 && term==allRcd[i].term ) {
strcpy(thisClass[j].classID,classID) ;
thisClass[j].term = term ;
strcpy(thisClass[j].name,allRcd[i].name);
thisClass[j].chinese = allRcd[i].chinese;
thisClass[j].math = allRcd[i].math ;
thisClass[j].english = allRcd[i].english ;
j++;
}
}
free(allRcd);
/////////////////////////////////////////////////////////////
getchar();
getchar();
while(1) {
system("cls");
showProgInform();
printf("Mention: The following operation will be all on the classId and term you input\n\n");
showSelectMenu(classID,term);
switch(getchar()) {
case '1':
getchar();
showStatistic(thisClass,thisSize,classID,term);
break;
case '2':
getchar();
sortSelectByAve(thisClass,thisSize);
getchar();
break;
case '3':
getchar();
noPass(thisClass,thisSize);
printf("0: Press 0 to return \"Select\" submenu\n");
if(getchar()=='0')
break;
default:
getchar();
return;
}
}
free(thisClass);
fclose(fp);
}
void go_on() {
printf("Press Enter to continue\n");
getchar();
}
void main() {
showProgInform();
while(1) {
showMenu();
switch(getchar()) {
case '1':
getchar();
inputRecord();
go_on();
break;
case '2':
getchar();
updateRecord();
getchar();
go_on();
break;
case '3':
getchar();
selectRecord();
getchar();
go_on();
break;
case '4':
getchar();
//exit(1);
return;
default:
getchar();
printf("Wrong Option! input again\n");
go_on();
break;
}
}
}
你以上的功能我的程序里全有,你自己看看改改吧!
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#define InputRcd 1
#define UpdateRcd 2
#define SelectRcd 3
#define Exit 4
#define NAMELEN 16
#define CLASSLEN 6
struct record {
char classID[CLASSLEN];
int term;
char name[NAMELEN];
int chinese,math,english;
};
void showProgInform()
{
printf("-------------------------------------------------\n");
printf("| *** STUDENTS' SCORE PLATFORM *** |\n");;
printf("-------------------------------------------------\n\n");
}
void showMenu() {
system("cls");
showProgInform();
printf("Please select an operation fo the following MENU: \n");
printf(" 1. Input a record \n");
printf(" 2. Update a record\n");
printf(" 3. Select record(s)\n");
printf(" 4. Exit. \n");
}
void inputRecord() {
struct record inscr;
FILE * fp;
system("cls");
showProgInform();
printf("Mention: You are to add new record\n\n");
printf("Please input by the following instructions: \n");
printf("Class ID: ");
scanf("%s",inscr.classID);
printf("Term Number: ");
scanf("%d",&(inscr.term));
printf("Student Name: ");
scanf("%s",inscr.name);
printf("Chinese score: ");
scanf("%d",&(inscr.chinese));
printf("Math score: ");
scanf("%d",&(inscr.math));
printf("English Score: ");
scanf("%d",&(inscr.english));
getchar();
if((fp=(fopen("stu_score.rcd","ab+")))==NULL) {
printf("Input record failed!\n");
return;
}
fwrite(&inscr,sizeof(struct record),1,fp);
fclose(fp);
if((fp=fopen("stu_score.txt","ab+"))==NULL) {
return;
}
fprintf(fp,"%s-%d %s: %d %d %d\r\n",inscr.classID,inscr.term,inscr.name,inscr.chinese,inscr.math,inscr.english);;
fclose(fp);
}
void showSingleRecord(struct record rc) {
printf("%s-%d %s: (CHI)%d (MAT)%d (ENG)%d\n",rc.classID,rc.term,rc.name,rc.chinese,rc.math,rc.english);
}
void updateRecord()
{
long fsize,arraySize,i;
struct record *allRecords,newRcd;
int hasFound = 0;
FILE * fp;
FILE * txt;
system("cls");
showProgInform();
if((fp = fopen("stu_score.rcd","rb")) == NULL ) {
printf("! No records , cannot operate\n");
return;
}
printf("Mention: You are to update record\n\n");
printf("Please the record you want to update by the follow mention: \n");
printf("Class Id: ");
scanf("%s",newRcd.classID);
printf("Term number: ");
scanf("%d",&newRcd.term);
printf("Student name: ");
scanf("%s",newRcd.name);
fseek(fp,0,SEEK_END);
fsize = ftell(fp);
arraySize = fsize/(sizeof(struct record));
allRecords = (struct record *)calloc(arraySize,sizeof(struct record));
rewind(fp);
fread(allRecords,sizeof(struct record),arraySize,fp);
for(i=0;i<arraySize;i++) {
if(strcmp(newRcd.classID,allRecords[i].classID)==0 && newRcd.term==allRecords[i].term && strcmp(newRcd.name,allRecords[i].name)==0) {
printf("Find the matching record: ");
showSingleRecord(allRecords[i]);
printf("Input new Score: \n");
printf("New Chinese Score: ");
scanf("%d",&(allRecords[i].chinese));
printf("New Math Score: ");
scanf("%d",&(allRecords[i].math));
printf("New English Score: ");
scanf("%d",&(allRecords[i].english));
printf("After update ,the records is : \n\t");
showSingleRecord(allRecords[i]);
printf("\n");
hasFound = 1;
break;
}
}
fclose(fp);
if(!hasFound) {
printf("No matching record has found!\n");
free(allRecords);
return;
}
if((fp = fopen("stu_score.rcd","w"))==NULL) {
printf("Write file stu_score.rcd failed\n");
return;
}
if((txt = fopen("stu_score.txt","w"))==NULL) {
printf("Write file stu_score.txt failed\n");
return;
}
fwrite(allRecords,sizeof(struct record),arraySize,fp);
for(i=0;i<arraySize;i++) {
fprintf(txt,"%s-%d %s: %d %d %d\r\n",allRecords[i].classID,allRecords[i].term,allRecords[i].name,allRecords[i].chinese,allRecords[i].math,allRecords[i].english);
}
free(allRecords);
fclose(fp);
fclose(txt);
}
void showSelectMenu(char classID[],int term) {
system("cls");
showProgInform();
printf("Mention: All the following opertion based on classID: %s,Term: %d\n\n",classID,term);
printf("Mention: You are to select the records\n\n");
printf("\t Please choose an operation: \n");
printf("\t 1. Select all records of the classID.\n");
printf("\t 2. Sort by the average score.\n");
printf("\t 3. Select no passed record.\n");
printf("\tOther. Return the high level menu.\n\n");
}
void showStatistic(struct record *r ,long size,char classID[],int term) {
int total;
float ave;
long i;
system("cls");
showProgInform();
printf("All records for class: %s,term: %d; total record nubmer: %ld\n",classID,term,size);
printf("********************************************************\n");
for(i=0;i<size;i++) {
total = r[i].chinese+r[i].english +r[i].math ;
ave = (float)total/3;
printf(" %s: (CHI)%d (MAT)%d (ENG)%d (Total)%d (Ave)%.2f\r\n",r[i].name,r[i].chinese,r[i].math,r[i].english,total,ave);
}
printf("********************************************************\n\n");
printf("Press Enter to return Select submenu\n");
getchar();
}
void sortSelectByAve(struct record * r,long size) {
FILE *fp;
struct record temp;
float outerAve ,innerAve;
int total;
long i,j;
system("cls");
showProgInform();
printf("\nSorted the records by average score\n");
for(i=0;i<size;i++) {
outerAve = (float)(r[i].chinese+r[i].math+r[i].english)/3;
for(j=i+1;j<size;j++) {
innerAve = (float)(r[j].chinese+r[j].math+r[j].english)/3;
if(innerAve > outerAve) {
strcpy(temp.name,r[j].name);
temp.chinese = r[j].chinese;
temp.math = r[j].math ;
temp.english = r[j].english ;
strcpy(r[j].name,r[i].name);
r[j].chinese = r[i].chinese ;
r[j].math = r[i].math ;
r[j].english = r[i].english ;
strcpy(r[i].name,temp.name);
r[i].chinese = temp.chinese ;
r[i].math = temp.math ;
r[i].english = temp.english ;
}
}
}
printf("\nshow sorted records \n");
printf("********************************************\n");
for(i=0;i<size;i++) {
total = r[i].chinese + r[i].math + r[i].english ;
innerAve = (float)total/3;
printf("%s: %d %d %d %d %f\n",r[i].name,r[i].chinese,r[i].math,r[i].english,total,innerAve);
}
printf("********************************************\n");
printf("write sorted records to \"sorted.txt\"\n");
if((fp = fopen("sorted.txt","w"))== NULL) {
printf("open sort.txt failed\n");
return;
}
for(i=0;i<size;i++) {
total = r[i].chinese + r[i].math + r[i].english ;
innerAve = (float)total/3;
fprintf(fp,"(CLASS-TERM)%s-%d (NAME)%s: (CHI)%3d (MAT)%3d (ENG)%3d (TOTAL)%4d (AVERG)%.2f\r\n",r[i].classID,r[i].term,r[i].name,r[i].chinese,r[i].math,r[i].english,total,innerAve);
}
printf("write file sorted.txt finished\n");
fclose(fp);
printf("\nPress any key to return Select subMenu\n");
}
void noPass(struct record * r,int size) {
long i=0,j=0;
FILE * fp;
if((fp=fopen("no-pass.txt","w"))==NULL) {
printf("create no-pass.txt failed");
return;
}
system("cls");
showProgInform();
printf("Mention: The following operation will be all on the classId and term you input\n\n");
printf("\nShow student that one subject is no-pass\n");
printf("***********************************************\n");
for(i=0;i<size;i++) {
if(r[i].chinese <60 || r[i].math<60 || r[i].english <60) {
printf("%s-%d %s: ",r[i].classID,r[i].term,r[i].name);
fprintf(fp,"%s-%d %s: ",r[i].classID,r[i].term,r[i].name);
if(r[i].chinese < 60 ) {
printf("(Chinese)%d ",r[i].chinese);
fprintf(fp,"(Chinese)%d ",r[i].chinese );
}
if(r[i].math < 60) {
printf("(Math)%d ",r[i].math);
fprintf(fp,"(Math)%d ",r[i].math);
}
if(r[i].english < 60) {
printf("(English)%d",r[i].english);
fprintf(fp,"(English)%d",r[i].english);
}
printf("\r\n");
fprintf(fp,"\r\n");
}
}
printf("***********************************************\n");
fclose(fp);
printf("Press Enter to return \"Select\" submenu\n");
}
void selectRecord() {
char classID[CLASSLEN];
int term;
FILE * fp;
long fsize=0,arraySize=0,thisSize=0,i=0,j=0;
struct record *allRcd,*thisClass;
system("cls");
showProgInform();
printf("Mention: The following operation will be all on the classId and term you input\n\n");
printf("Mention: please operate by the following instructions\n\n");
printf("Input ClassID: ");
scanf("%s",classID);
printf("Input term number: ");
scanf("%d",&term);
if((fp=fopen("stu_score.rcd","r"))==NULL) {
printf("\nWarining: No record exists!\n");
return;
}
fseek(fp,0,SEEK_END);
fsize = ftell(fp);
arraySize = fsize/(sizeof(struct record));
allRcd = (struct record *)calloc(arraySize,sizeof(struct record));
rewind(fp);
fread(allRcd,sizeof(struct record),arraySize,fp);
printf("Press Enter to show the sub menu of Select menu\n");
for(i=0;i<arraySize;i++) {
if(strcmp(classID,allRcd[i].classID)==0 && term==allRcd[i].term) {
thisSize++;
}
}
if(thisSize==0) {
printf("\nWaring: No record for Class %s Term %d\n",classID,term);
fclose(fp);
free(allRcd);
return;
}
thisClass = (struct record *)calloc(thisSize,sizeof(struct record));
j=0;
for(i=0;i<arraySize;i++) {
if(strcmp(classID,allRcd[i].classID)==0 && term==allRcd[i].term ) {
strcpy(thisClass[j].classID,classID) ;
thisClass[j].term = term ;
strcpy(thisClass[j].name,allRcd[i].name);
thisClass[j].chinese = allRcd[i].chinese;
thisClass[j].math = allRcd[i].math ;
thisClass[j].english = allRcd[i].english ;
j++;
}
}
free(allRcd);
/////////////////////////////////////////////////////////////
getchar();
getchar();
while(1) {
system("cls");
showProgInform();
printf("Mention: The following operation will be all on the classId and term you input\n\n");
showSelectMenu(classID,term);
switch(getchar()) {
case '1':
getchar();
showStatistic(thisClass,thisSize,classID,term);
break;
case '2':
getchar();
sortSelectByAve(thisClass,thisSize);
getchar();
break;
case '3':
getchar();
noPass(thisClass,thisSize);
printf("0: Press 0 to return \"Select\" submenu\n");
if(getchar()=='0')
break;
default:
getchar();
return;
}
}
free(thisClass);
fclose(fp);
}
void go_on() {
printf("Press Enter to continue\n");
getchar();
}
void main() {
showProgInform();
while(1) {
showMenu();
switch(getchar()) {
case '1':
getchar();
inputRecord();
go_on();
break;
case '2':
getchar();
updateRecord();
getchar();
go_on();
break;
case '3':
getchar();
selectRecord();
getchar();
go_on();
break;
case '4':
getchar();
//exit(1);
return;
default:
getchar();
printf("Wrong Option! input again\n");
go_on();
break;
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询