全文预览

C++课程设计:学生选课管理系统 (2)

上传者:hnxzy51 |  格式:docx  |  页数:43 |  大小:426KB

文档介绍
ubject::getaverage()Р{Рfloat k = 0.0;Рstudentname *p;Рp=first->Next;Рif(p==NULL)Рreturn 0;Рwhile(p)Р{Рk = k + p->result;Рp = p->Next ;Р}Рreturn k/;Р}Рfloat subject::getresult (char N[])Р{Рstudentname *p;Рp = first;Рwhile(p)Р{Рif(strcpy(p->tname ,N)==0)Рreturn p->result;Рp = p->Next ;Р}Рreturn -1;Р}Рvoid subject::getkname (char N[])Р{Рstrcpy(N,kname);Р}Рvoid subject::setkname (char N[])Р{Рstrcpy(kname,N);Р}Рvoid subject::findstudent(studentdb *P)Р{Рstudentname *newcode = new studentname;Рnewcode->Next=NULL;Рfirst = newcode;Рstudentname *T = first;Рstudentdb *K = P->Next;Рwhile(K)Р{Рcourse *Y = K->stu.retroot();Рif(Y ==NULL)Р{РK = K->Next;Рcontinue;Р}Рif(Y!=NULL)РY = Y->Next;Рwhile(Y)Р{Рif(strcmp(Y->cname,kname)==0)Р{Рstudentname *Acode = new studentname;Рchar Name[20];РK->stu.getname(Name);

收藏

分享

举报
下载此文档