private:
int maxstudent; //最多学生数
int activestudnet; //实际学生数
studentname *first; //学生名单
float credit; //该课程的学分
float averagerusult; //该课程的平均成绩
char kname[20]; //该课程的名称
};
float subject::readcredit ()
{
return credit;
}
void subject::getcredit (float a)
{
credit=a;
}
float subject::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/activestudnet;
}
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;
}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页