q = P->Next;
if(q==NULL)
return 1;
cout<<"\n\n\t\t 请输入学生姓名:";
cin>>N;
i=0;
q=P->Next;
while(q)
{
q->stu.getname(M);
if(strcmp(N,M)==0)
i++;
q = q->Next;
}
int j=0,k=1;
if(i==0)
{
cout<<"\n\n\t\t没有这个学生!! 请按任意键返回.."<<endl;
return 1;
}
else if(i>1)
{
cout<<"\n\n\t\t共找到"<<i<<"个姓名为"<<N<<"的学生"<<endl;
cout<<"\t\t选择第几个:";
cin>>k;
}
if(k>i||k<=0)
{
cerr<<"\n\t\t\t输入有误!按任意键继续"<<endl;
return 1;
}
q = P->Next;
j=0;
while(q)
{
q->stu.getname(M);
if(strcmp(N,M)==0)
j++;
if(j==k)
{
if(q->stu.retfactcourse()>=q->stu.retmaxcourse())
{
cout<<"\n\t\t所选课程已满!按任意键继续"<<endl;
return 1;
}
else
{
subjectdb *t=X->Next;
char N1[20];
system("cls");
if(t!=NULL)
{
cout<<"\n\n\n\t\t所有课程如下:"<<endl;
cout<<"\n\t\t\t\t课程名称\t\t 学分"<<endl;
}
else
{
cerr<<"\n\n\n\t\t对不起,暂时没有课程"<<endl;
return 1;
}
while(t)
{
t->sub.getkname(N1);
cout<<"\t\t\t\t "<<N1<<setw(26-strlen(N1))<<t->sub.readcredit()<<endl;
t = t->Next ;
}
char N2[20];
cout<<"\n\t 输入你所要选的课程 : ";
cin>>N2;
t = X->Next;
while(t)
{
t->sub.getkname(N1);
if(strcmp(N1,N2)==0)
{
if(q->stu.findcourse(N2)==1)
{
cout<<"\n\t\t此课程你已选过了,不能再选.按任意键继续"<<endl;
return 1;
}
t=X->Next;
char NA[20];
while(t)
{
t->sub.getkname(NA);
if(strcmp(NA,N2)==0)
{
if(t->sub.retactivestudent()>=t->sub.retmaxstudent ())
{
cout<<"\n\t\t此课程已选满,不能选.按任意键继续"<<endl;
www.751com.cn
q->stu.addcourse(N2,0.0);
cout<<"\n\n\t\t选课成功!按任意键继续"<<endl;
return 1;
}
t = t->Next;
}
cerr<<"\n\t\t没有此课程!按任意键继续"<<endl;
}
return 1;
}
q = q->Next;
}
return 1;
}
int stuInform(studentdb *P,subjectdb *X) //学生情况
{
studentdb *q=P->Next;
char N[20];
system("cls");
cout<<"\n\n\t\t\t\t学生情况操作"<<endl;
int i;
if(q!=NULL)
{
cout<<"\n\n\n\t\t所有学生选课信息如下:\n"<<endl<<endl;
cout<<"\t\t 姓名\t\t\t选课情况\n"<<endl;
}
else
{
cerr<<"\n\n\n\t\t对不起,暂时没有学生名单!!请按任意键继续.."<<endl;
return 1;
}
while(q)
{
q->stu.getname(N);
cout<<"\t\t "<<N<<setw(25-strlen(N))<<" 已选 "<<q->stu.retfactcourse()<<" 门课 "<<endl;
q = q->Next ;
}
char M[20];
cout<<"\n\t\t输入要查看的学生姓名:";
cin>>M;
i=0;
q=P->Next;
while(q)
{
q->stu.getname(N);
if(strcmp(N,M)==0)
i++;
q = q->Next;
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页