diff --git a/机房收费管理系统2.0.cpp b/机房收费管理系统2.0.cpp index 3ae0509..5bd2fec 100644 --- a/机房收费管理系统2.0.cpp +++ b/机房收费管理系统2.0.cpp @@ -156,7 +156,7 @@ void fee() // break; } } - if(i==14) + if(i==15) { printf(" Ϣδ¼!\n"); printf(" һ........\n"); diff --git a/机房收费管理系统2.0.exe b/机房收费管理系统2.0.exe new file mode 100644 index 0000000..080b1a1 Binary files /dev/null and b/机房收费管理系统2.0.exe differ diff --git a/机房收费管理系统3.0.cpp b/机房收费管理系统3.0.cpp new file mode 100644 index 0000000..5bd2fec --- /dev/null +++ b/机房收费管理系统3.0.cpp @@ -0,0 +1,315 @@ +#include +#include +#include + +struct +{ + char id[20]; + char name[20]; + char _class[5]; + char online[1]; + float _fee; + float begin_hour; + float begin_min; + float end_hour; + float end_min; +}student[15]; + +void dengji(); +void shangji(); +void fee(); +void xiugai(); +void chaxun(); +void tuichu(); + +int i,k,m; + +int main(void) +{ + int select; + do + { + printf("*****************ӭշѹϵͳ*****************\n"); + printf(" 1.ѧǼ\n"); + printf(" 2.ѧϻʱ\n"); + printf(" 3.ѧ»ʱ估\n"); + printf(" 4.޸ѧϢ\n"); + printf(" 5.ѯѧϢ\n"); + printf(" 6.˳ϵͳ\n"); + printf("*****************ӭշѹϵͳ*****************\n"); + printf(" ѡ:"); + scanf("%d",&select); +switch(select) +{ +case 1: getchar(); + dengji(); + break; + +case 2: getchar(); + shangji(); + break; + +case 3:getchar(); + fee(); + break; + +case 4:getchar(); + xiugai(); + break; + +case 5:getchar(); + chaxun(); + break; + +case 6:tuichu(); + break; + +default:break; +} +system("cls"); +}while(select!=6); + +return 0; + +} + +void dengji() //ѧϢ// +{ + static int j=0; + system("cls"); + printf("****************ѧϢǼ****************\n"); + for(i=j;i<15;i++) + { + char c; + printf("༶:"); + gets(student[i]._class); + printf("ѧ:"); + gets(student[i].id); + printf(":"); + gets(student[i].name); + printf("Ƿ룿(YN)"); + scanf("%c",&c); + if(c=='N'||c=='n') + { + j=i+1; + break; + } + getchar(); + printf("\n"); + } + if(i==15) + printf("¼ѧ"); +} + +void shangji() //ϻ// +{ + char _id[20]; + system("cls"); + printf("****************ϻʱǼ****************\n"); + printf("ϻѧѧ:"); + gets(_id); + for(i=0;i<15;i++) +{ + if(strcmp(_id,student[i].id)==0) + { + printf("ϻʱ:(ʽ1200)"); + scanf("%f%f",&student[i].begin_hour,&student[i].begin_min); + printf("һ........\n"); + system("pause"); + break; + } +} + if(i==15) + { + printf(" Ϣδ¼!\n"); + printf(" һ........\n"); + system("pause"); + + } + +} + +void fee() //»// +{ + char _id[20]; + system("cls"); + printf("****************»ʱ估õǼ****************\n"); + printf("ÿСʱ5Ԫ\n"); + printf("»ѧѧ:"); + gets(_id); + for(i=0;i<15;i++) +{ + if(strcmp(_id,student[i].id)==0) + { + if(!(student[i].begin_hour&&student[i].begin_min)) + { + printf("δϻ!\n"); + system("pause"); + break; + } + printf("»ʱ:(ʽ1200)"); + scanf("%f%f",&student[i].end_hour,&student[i].end_min); + student[i]._fee=(student[i].end_hour+student[i].end_min/60-student[i].begin_hour-student[i].end_min/60)*5; + printf("Ϊ:%.1f\n",student[i]._fee); + printf("һ........\n"); + system("pause"); + break; + } +} + if(i==15) + { + printf(" Ϣδ¼!\n"); + printf(" һ........\n"); + system("pause"); + } + +} + +void chaxun() //ѯ// +{ + char _id[20]; + system("cls"); + printf("*************************************ѧϢѯ*************************************\n"); + printf(" ѡ\n"); + printf(" 1ѯ\n"); + printf(" 2ȫѯ\n"); + printf(" 룺"); + scanf("%d",&k); + switch(k) + { + case 1: + getchar(); + system("cls"); + printf("ѯѧѧţ"); + gets(_id); + for(i=0;i<15;i++) + { + if(strcmp(_id,student[i].id)==0) + { + system("cls"); + printf("*************************************ѧϢѯ*************************************\n"); + printf(":%s\t",student[i].name); + printf("༶:%s\t",student[i]._class); + printf("ѧ:%s\t",student[i].id); + printf("ϻʱ: %g:%g\t",student[i].begin_hour,student[i].begin_min); + printf("»ʱ: %g:%g\t",student[i].end_hour,student[i].end_min); + printf("ϻ: %.1f\n",student[i]._fee); + } + } + if(i==15) + printf("\nϢδ¼룡\n"); + printf("\n\nһ\n\n"); + system("pause"); + break; + + case 2: + system("cls"); + printf("*************************************ѧϢѯ*************************************\n"); + printf("༶\t\t"); + printf("ѧ\t\t"); + printf("\t\t"); + printf("ϻʱ\t"); + printf("»ʱ\t"); + printf("ϻ\t"); + printf("״̬\n"); + for(i=0;i<15;i++) + { + printf("%s\t\t",student[i]._class); + printf("%s\t\t",student[i].id); + printf("%s\t\t",student[i].name); + printf("%g:%g\t\t",student[i].begin_hour,student[i].begin_min); + printf("%g:%g\t\t",student[i].end_hour,student[i].end_min); + printf("%.1f\t\t",student[i]._fee); + if(student[i].begin_hour==0) + printf("δϻ"); + else if(student[i].begin_hour!=0&&student[i].end_hour==0) + printf(""); + else if(student[i].begin_hour!=0&&student[i].end_hour!=0) + printf(""); + printf("\n"); + } + printf("*************************************ѧϢѯ*************************************\n"); + printf("\n\nһ"); + system("pause"); + getchar(); + break; + } +} + +void xiugai() //޸// +{ + char _id[20],name[20],banji[5]; + int eh,em,n,bh,bm; + int m; + system("cls"); + printf("****************޸ѧϢ****************\n"); + printf("Ҫ޸ѧѧţ\n"); + gets(_id); + for(i=0;i<15;i++) +{ + if(strcmp(_id,student[i].id)==0) +{ + printf("ѡҪ޸ĵݣ1 2༶ 3ϻʱ 4»ʱ 5ɾϢ\n"); + scanf("%d",&n); + switch(n) + { + case 1: + printf("µ:\n"); + getchar(); + gets(name); + strcpy(student[i].name,name); + system("pause"); + break; + + case 2: + printf("µİ༶:\n"); + getchar(); + gets(banji); + strcpy(student[i]._class,banji); + system("pause"); + break; + + case 3: + printf("µϻʱ:\n"); + getchar(); + scanf("%d:%d",&bh,&bm); + student[i].begin_hour=bh; + student[i].begin_min=bm; + system("pause"); + break; + + case 4: + printf("µ»ʱ:\n"); + getchar(); + scanf("%d:%d",&eh,&em); + student[i].end_hour=eh; + student[i].end_min=em; + student[i]._fee=(student[i].end_hour+student[i].end_min/60-student[i].begin_hour-student[i].end_min/60)*5; + system("pause"); + break; + + case 5: + for(m=i+1;m<15;m++) + { + student[m-1]=student[m]; + } + printf("ѳɹɾϢ"); + system("pause"); + break; + } + break; +} +} + if(i==15) + { + printf("ѧǷ\n"); + system("pause"); + } +} + +void tuichu() +{ + system("cls"); + printf("*****************лʹûշѹϵͳ*****************\n"); + system("pause"); + }