滨江学院课程设计报告
附录:源程序清单 #include
//时间类
class time {public:
time(int y=0,int m=0,int d=0) {year=y;month=m;day=d;} ~time(){} protected: }; //信息类
class xinxi:public time { public:
xinxi(){ tiaoshu++;} ~xinxi(){tiaoshu--;}
void setname(char *n){strcpy(name,n);}
void settime(int y,int m,int d){year=y;month=m;day=d;} void setqklx(char *qk){strcpy(queke,qk);} void setjieci(char *jc){strcpy(jieci,jc);} void setkechen(char *kc){strcpy(kechen,kc);}
int year,month,day;
滨江学院课程设计报告
char *getname(){char *n;n=name;return n;} char *getqklx(){char *qk=queke;return qk;} char *getjieci(){char *jc;jc=jieci;return jc;} char *getkechen(){char *gk;gk=kechen;return gk;} int *gettime(); private:
char name[20];//姓名
char jieci[3],kechen[10],queke[10]; int tm[3]; };
int xinxi::tiaoshu=0;
int *xinxi::gettime() { int *t; t=tm; }
//缺课课程类
class qkechen:public xinxi {public:
qkechen(){kcshu++;} ~qkechen(){kcshu--;} int getrc(xinxi st1[],int n,int j); char qkn[20];//公有数据成员 private:
static int tiaoshu;
tm[0]=year; tm[1]=month; tm[2]=day; return t;
滨江学院课程设计报告
int renci;
static int kcshu;//静态数据成员 };
int qkechen::kcshu=0;
int qkechen::getrc(xinxi st1[],int n,int j) { renci=0; renci++; for(int i=0;i if(*(st1[i+1].gettime()+1)==*(st1[j].gettime()+1)&&*(st1[i+1].gettime()+2)== } //缺课学生类 class qstu:public xinxi {public: qstu(){qst++;} ~qstu(){qst--;} void print(xinxi &st1); int getjs(xinxi st1[],int n,int j); int setjs(int js=0) {jieshu=js;} char qstn[20]; private: int jieshu; static int qst; //静态数据成员 }; *(st1[j].gettime()+2)) if(strcmp(qkn,st1[i].getkechen())==0) renci++; return renci; 滨江学院课程设计报告 int qstu::qst=0; //类的实现 void qstu::print(xinxi &st1) { cout<<\缺课日期 |\第几节课 |\课程名称 |\缺课类型|\ cout<<\)<<\ < int qstu::getjs(xinxi st1[],int n,int j) { int i=0,js=0; xinxi min; if(*(st1[j].getjieci()+2)!='\\0') js=+2; else js++; for(i=0;i if(*(st1[i+1].gettime()+1)==*(st1[j].gettime()+1)&&*(st1[i+1].gettime()+2)==*(st1[j].gettime()+2)) if(strcmp(st1[i+1].getname(),qstn)==0) { } if(*(st1[i].getjieci()+2)!='\\0') js=+2; else js++; 滨江学院课程设计报告 } jieshu=js; return jieshu; // 函数声明 int shuru(xinxi st1[]); void chaxun(xinxi st1[],qstu qt[]); void xiugai(xinxi st1[],int n); void tongji1(xinxi st1[],qstu qt1[]); void tongji2(xinxi st1[],qkechen qk1[]); void caidan(); void xiansi(xinxi &st1); void setqstn(xinxi st1[],qstu qt1[],int n); void setqkn(xinxi st1[],qkechen qk[],int n); //全局变量 int g,k=1,b=1; int q=-1; char name[20],kechen[10],queke[10],jieci[3]; int y,m,d; //主函数 int main() { xinxi tl[15];//定义15条信息类对象 qstu qt[10]; qkechen qk[6]; int ch; while(1) {cout<<\欢迎进入学生考勤管理系统!*********\ caidan(); cout<<\请选择菜单项:\