c++ 程序题

来源:百度知道 编辑:UC知道 时间:2024/05/22 18:27:05
1. 考勤信息记录了学生的缺课情况,它包括:缺课日期、第几节课、课程名称、学生姓名、缺课类型(迟到、早退、请假及旷课)。试设计考勤管理系统,使之能提供以下功能:
a) 建立系统管理人员表,对系统管理人员设置操作权限,登录系统时检查操作权限;
b) 有相应权限的系统管理人员可以添加、修改系统里的其他低权限的管理人员;
c) 录入学生的缺课记录;
d) 修改某个学生的缺课记录;
e) 查询某个学生的缺课情况;
f) 统计某段时间内,旷课学生姓名及旷课次数,按旷课次数由多到少排序;
g) 统计某段时间内,有学生旷课的课程及旷课人次,按旷课人次由多到少排序;
h) 系统以菜单方式工作。

#include<iostream.h>
#include<string.h>
#include<iomanip.h>
#include<conio.h>
#include<iostream>
struct student //定义一个学生结构体
{ char name[8];
int num;
char bj[20];
int GS,YY,JSJ,SUM; };
int s=0;
class student1 //定义一个学生类
{ private: student stu[40];
char name,bj;
int num; int GS,YY,JSJ,SUM;
public:
void sr(char *,int,char *,int,int,int);
void print(int);
int jc(int xxh) { int m=0;
while(m<=s+1)
if(xxh==stu[m++].num) break;
if(m>s+1) return 0;
else
return 1; }
void cz(int);
void sc(int);
void sum(int); };
void student1::sr(char *xm,int xh,char *dz,int gs,int yy,int jsj) //输入模块
{ strcpy(stu[s].name,xm);
stu[s].num=xh; strcpy(stu[s].bj,dz); stu[s].GS=gs;
stu[s].YY=yy;
stu[s].JSJ=jsj; }
void student1::print(int s) //输出模块
{ cout<<s<<"\t"