//////////////新增添加学生和成绩录入系统
#include<iostream>
#include <string>
#include<conio.h>
void bangzhu();
using namespace std;
class 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 shuruchengji()
{int i;
for(i=0;i<5;i++)
{
cout<<"请输入"<<kc[i]<<"的成绩";
cin>>cj[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;}
}
}
}
int main() ////主函数..................................................................................
{int n,i;
string mm;
student stu[500];
mm=mima();
i=denglu(mm);
if(i)
{ cout<<"请输入学生人数: ";
cin>>n;
system("cls");
for(i=0;i<n;i++)
stu[i].sr();
int a;
bangzhu();
while(cin>>a)
{if(a==0)
break;
else
{
switch(a)
{case 1: (n++,stu[n].sr());break;
case 2: for(i=0;i<n;i++) {cout<<stu[i].xm;stu[i].chengji();}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<<" 9."<<endl;
cout<<"============================"<<endl;
cout<<" 0.结束本程序 "<<endl ;
cout<<"============================"<<endl;
}

最新文章

  1. jQuery.lazyload
  2. shell命令获取最新文件的名称
  3. 【数据结构】非常有用的hash表
  4. 需要 了解 j2ee 框架
  5. Emacs下编译C++/C程序&lt;转&gt;
  6. Android学习笔记27:网格视图GridView的使用
  7. Quartz.NET总结(一)
  8. 聊聊GIS中那些坐标系
  9. 离线缓存 manifest
  10. DOS基本命令(基本部分)
  11. south 命令学习
  12. springboot 实现配置文件给常量赋值
  13. Codeforces Round #543
  14. [数据结构] 快速排序C语言程序
  15. UglifyJs打包压缩问题引起的思考
  16. PAT B1035 插入与归并 (25 分)
  17. 关于supervisor无法监控golang代码的解决方法
  18. mybatis 控制台打印sql脚本
  19. mybatis 一二事(1) - 简单介绍
  20. 一款开源免费的办公套件系统:DzzOffice详细部署

热门文章

  1. 【C++】动态开辟二维数组
  2. 读书笔记:《梦断代码Dreaming in Code》
  3. 利用python 提取log 文件里的关键句子,并进行统计分析
  4. Android-IA Power Manager (S3)
  5. mysql5.1,5.5,5.6做partition时支持的函数
  6. poj 2010 Moo University - Financial Aid (贪心+线段树)
  7. Java并发编程(您不知道的线程池操作)
  8. Codeforces Round #256 (Div. 2) D. Multiplication Table(二进制搜索)
  9. 【原创】用Python爬取LeetCode的AC代码到Github
  10. C和指针 (pointers on C)——第十四章:预处理器