int deleteCourse(subjectdb *P) //删除课程
{
subjectdb *q=P->Next;
char N[20];
system("cls");;
cout<<"\n\n\t\t\t\t删除课程操作"<<endl;
if(q!=NULL)
cout<<"\n\n\n\t\t所有课程如下:\n"<<endl;
else
{
cerr<<"\n\n\n\t\t对不起,暂时没有课程!!请按任意键继续.."<<endl;
return 1;
}
while(q)
{
q->sub.getkname(N);
cout<<"\t\t\t\t"<<N<<endl;
q = q->Next ;
}
q = P->Next;
subjectdb *R = P;
if(q==NULL)
return 1;
char M[20];
cout<<"\n\t 请输入要删除的课程 :";
cin>>M;
while(q)
{
q->sub.getkname(N);
if(strcmp(N,M)==0)
{
R->Next = q->Next;
free(q);
cout<<"\n\t\t删除课程操作成功,按任意键继续"<<endl;
return 1;
}
q = q->Next;
R = R->Next;
}
cerr<<"\n\t\t没有此课程!!\t请按任意键继续.."<<endl;
return 1;
}
int insertScore(studentdb *X,subjectdb *P) //填写成绩
{
subjectdb *q=P->Next;
char M[20],N[20],NA[20];
float score;
system("cls");
cout<<"\n\n\t\t\t\t 填写成绩操作\n"<<endl;
if(q!=NULL)
cout<<"\n\t\t\t课程名称\t\t选课人数\n"<<endl;
else
{
cout<<"\n\n\n\t\t对不起,暂时没有任何选修课程。请按任意键继续.."<<endl;
return 1;
}
while(q)
{
q->sub.getkname(N);
cout<<"\t\t\t"<<N<<setw(28-strlen(N))<<q->sub.retactivestudent()<<endl;
q = q->Next ;
}
q = P->Next;
cout<<"\n\t请输入课程名称 :";
cin>>M;
while(q)
{
q->sub.getkname(N);
studentname *K = q->sub.retfirst();
if(K!=NULL)
K = K->Next;
if(strcmp(N,M)==0)
{
system("cls");;
if(K!=NULL)
{
cout<<"\n\n\t\t请填写选修"<<M<<"的学生成绩\n"<<endl;
cout<<"\n\t\t\t姓名\t\t成绩"<<endl;
}
if(K==NULL)
cerr<<"\n\t\t\t无任何信息!!请按任意键继续.."<<endl;
while(K)
{
cout<<"\n\t\t\t"<<K->tname<<"\t\t ";
cin>>score;
studentdb *XX = X->Next;
while(XX)
{
XX->stu.getname(NA);
if(strcmp(NA,K->tname)==0)
XX->stu.wrecourse(M,score);
XX = XX->Next;
}
K = K->Next;
}
if(K==NULL)
cout<<"\n\t\t填写成绩完毕!!请按任意键继续.."<<endl;
return 1;
}
q = q->Next;
}
cerr<<"\n\t\t没有此课程!!请按任意键继续.."<<endl;
return 1;
}
int changeSC(subjectdb *P) //更改学分
{
float k;
system("cls");
cout<<"\n\n\n\t\t\t\t更改学分操作\n"<<endl;
subjectdb *q = P->Next;
char N[20],M[20];
if(q!=NULL)
cout<<"\n\n\n\t\t 所有课程如下:\n"<<endl;
else
{
cerr<<"\n\n\n\t\t对不起,暂时没有任何可选课程。请按任意键继续.."<<endl;
return 1;
}
while(q)
{
q->sub.getkname(N);
cout<<"\t\t\t\t "<<N<<endl;
q = q->Next ;
}
q = P->Next;
cout<<"\n\n\n\t\t请输入要改的课程 :";
cin>>M;
while(q)
{
q->sub.getkname(N);
if(strcmp(N,M)==0)
{
cout<<"\n\t\t\t原来学分为 :"<<q->sub.readcredit()<<endl;
cout<<"\n\t\t\t现要更改为 :";
cin>>k;
q->sub.getcredit(k);
cout<<"\n\t\t更改课程学分成功,按任意键继续"<<endl;
return 1;
}
q = q->Next;
}
cerr<<"\n\t\t无此课程!!请按任意键继续.."<<endl;
return 1;
}int stuInform(studentdb *P) //学生情况
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页