学籍管理系统
功能需求:
根据上述的信息管理系统的业务流程、要求以及所要实现的目标,我们可以拟出以下需求目标:
(1)建立学生档案的管理和维护。实现计算机自动化管理体制。
(2)建立学生成绩管理机制,在计算机的支持下快速的完成学生成绩的查询和修改。
(3)建立课程设置管理,在计算机的支持下实现课程的添加、删除、修改。
(4)建立班级设置管理,在计算机的支持下实现班级的添加、删除和修改。
(5)实现系统的权限设置管理,保证系统安全性。(登录密码输错3次不允许登录)
(6)可以在黑框框运行。..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
#include<iostream> #include <string> #include<conio.h> void bangzhu(); using namespace std; struct sj {public : int year,month,day; ////////时间类 void shuru() {cin>>year>>month>>day; } }; class student ////////////学生类 { public : string xm,kc[5]; int bj,xh,cj[5]; sj time; void sr() //////初始化输入学生信息 {cout<<"请输入学号"; cin>>xh; system("cls"); cout<<"请输入姓名"; cin>>xm; system("cls"); cout<<"请输入入学日期中间用空格隔开"; time.shuru(); system("cls") ; cout<<"请输入班级"; cin>>bj; system("cls"); cout<<"请输入课程(5门)中间用空格隔开"; for(int i=0;i<5;i++) cin>>kc[i]; system("cls");} void chengji() ///////成绩录入 {int i; for(i=0;i<5;i++) {cout<<"请输入"<<kc[i]<<"的成绩"<<endl; cin>>cj[i];} } void chengjisc() ///////成绩输出 {int i; for(i=0;i<5;i++) {cout<<kc[i]<<" "; cout<<cj[i]<<' ';} } }; void cxkb(student t) {int n; cout<<"继续查询课程表请输入1,结束请输入0"<<endl; cin>>n; if(n==1) for(int i=0;i<5;i++) cout<<t.kc[i]<<' '; } string mima() ////////初始化设置密码 {cout<<"请设置密码:"; string mm1,mm2; char ch; while ((ch=_getch())!=13) { mm1+=ch; cout<<"*"; } cout<<endl; cout<<"请再次确认密码:"; while ((ch=_getch())!=13) { mm2+=ch; cout<<"*"; } system("cls"); if(mm1==mm2) return mm1; else mima(); } int denglu(string mm) /////////登陆程序 { cout<<"请输入登陆密码:"; string mm1; char ch; while ((ch=_getch())!=13) { mm1+=ch; cout<<"*"; } system("cls"); if(mm==mm1) return 1; else {cout<<"密码错误,您还有两次机会,请重试"; while ((ch=_getch())!=13) { mm1+=ch; cout<<"*"; } system("cls"); if(mm==mm1) return 1; else {cout<<"密码错误,您还有一次机会,请重试"; while ((ch=_getch())!=13) { mm1+=ch; cout<<"*"; } system("cls"); if(mm==mm1) return 1; else {cout<<"密码错误,请明天再试"; return 0;} } } } student chazhaoxg(student t) {cout<<"修改姓名请输入1,修改入学时间请输入2,修改班级请输入3."<<endl; cout<<"修改课程请输入4,修改成绩请输入5"; int a,i; string xk; cin>>a; switch(a) {case 1:cin>>t.xm;break; case 2:cin>>t.time.year>>t.time.month>>t.time.day;break; case 3:cin>>t.bj;break; case 4:for(i=0;i<5;i++) cin>>t.kc[i];break; case 5:cout<<"请输入课程名"<<endl;cin>>xk;for(i=0;i<5;i++) {if(t.kc[i]==xk){cout<<"请输入成绩"<<endl;;cin>>t.kc[i];}}break; } return t; } void shuchuxinxi(student t) { cout<<t.xh<<' '<<t.xm<<' '<<t.time.year<<t.time.month<<t.time.day<<t.bj<<' '; } int main() ////主函数.................................................................................. {int n=0,i,xh; string mm; student stu[500]; mm=mima(); i=denglu(mm); if(i) { int a; while(1) { bangzhu(); cin>>a;system("cls"); if(a==0) break; else { switch(a) {case 1: (stu[n].sr(),n++);break; case 2: for(i=0;i<n;i++){cout<<stu[i].xh<<' ';cout<<stu[i].xm<<endl;}break; case 3: cout<<"请输入学号 ";cin>>xh;for(i=0;i<n;i++) if(stu[i].xh==xh) stu[i]=chazhaoxg(stu[i]);break; case 5:cout<<"请输入学号 ";cin>>xh;for(i=0;i<n;i++) if(stu[i].xh==xh) stu[i].chengji();break; case 6:cout<<"请输入学号 ";cin>>xh;for(i=0;i<n;i++) if(stu[i].xh==xh) stu[i].chengjisc();break; case 4: cout<<"请输入学号 ";cin>>xh;for(i=0;i<n;i++) if(stu[i].xh==xh) {shuchuxinxi(stu[i]);cxkb(stu[i]);}break; case 9:bangzhu();break;}} }} return 0; } void bangzhu() //操作指令提示 { cout<<"请输入以下指令"<<endl<<endl; cout<<" 1.添加学生 " <<endl; cout<<"============================"<<endl; cout<<" 2.输出所有学生 "<<endl; cout<<"============================"<<endl; cout<<" 3.输入学号修改学生信息 "<<endl; cout<<"============================"<<endl; cout<<" 4,用学号查找学生信息"<<endl; cout<<"============================"<<endl; cout<<" 5,成绩输入"<<endl; cout<<"============================"<<endl; cout<<" 6,成绩查询"<<endl; cout<<"============================"<<endl; cout<<" 9.指令集"<<endl; cout<<"============================"<<endl; cout<<" 0.结束本程序 "<<endl ; cout<<"============================"<<endl; } |
This article is automatically posted by WP-AutoPost : WordPress自动采集发布插件
HTML标签过滤,WP-AutoPost