📄 nnn.cpp
字号:
angle_ptr2->init_stu();
if(a==1) break;
p1->stu=angle_ptr2;
}
p2->next=NULL;
return head1;
}
//---------------------------------------------------
int main()
{ void iden_and_oper(void); //确认身份和进行相关操作函数
void Admi_oper(void); //学生办工作人员进行相关操作的函数
void Maj_oper(void); //主修系教务员进行相关操作的函数
void min_oper(void); //辅修系教务员进行相关操作函数
void Mod(int y); //进行修改学生资料函数
void Maj_oper_Init(void); //主修系教务人员进行初始化学生主修系资料函数
void Min_oper_Init_score(void); //辅修系教务员进行初始化学生辅修分数操作函数
void choice(int i); //选择函数
void Deg_oper(void); //学位办工作人员进行操作函数
iden_and_oper();
return 0;
}
void choice(int q)
{
switch(q)
{
case 1:
{
p1->stu->modify_infor(); //学工办修改学生资料函数
p1->stu->show();
break;
}
case 2:
{
p1->stu->modify(); //主修系教务员修改学生资料函数
p1->stu->show_maj();
break;
}
case 3:
{
p1->stu->Fmodify(); //辅修系教务员修改学生资料函数
p1->stu->show_Fxco();
break;
}
case 4:
{
p1->stu->set_fdep();
p1->stu->show_Fxco();
break;
}
case 5:
{
p1->stu->initial(); //主修系教务员初始化学生资料
break;
}
case 6:
{
p1->stu->set_fscore(); //辅修教务员初始化学生资料
p1->stu->show_Fxco();
break;
}
case 7:
{
p1->stu->show();
p1->stu->show_maj();
p1->stu->show_Fxco();
p1->stu->show_statics();
}
}
}
void Mod(int k)
{
int h,nu;
char nam[30],ch;
do
{
cout<<"Which way do you want to chose to find the student?\n";
cout<<"1. Find throught the number.\n";
cout<<"2. Find throught the name.\n";
cout<<"Your answer is: ";
cin>>h;
cin.get();
switch(h)
{
case 1:
{
cout<<"Input the students' number!\n";
cin>>nu;
for(p1=head;p1!=NULL;p1=p1->next)
{
p1->stu->sech_num(nu);
if(a==1)
{
choice(k);
break;
}
}
if(a==0)
cout<<"The student is not here!\n";
break;
}
case 2:
{
cout<<"Inout the student's name!\n";
cin.getline(nam,30);
for(p1=head;p1!=NULL;p1=p1->next)
{
p1->stu->sech_nam(nam);
if(a==1)
{
choice(k);
break;
}
}
if(a==0)
cout<<"The student is not here!\n";
break;
}
}
cout<<"continue?\n";
cin>>ch;
}while(ch=='y');
}
void Deg_oper()
{
cout<<"Do you want to check all the imformation?\n";
Mod(7);
}
void Maj_oper_Init()
{
Mod(5);
for(p1=head;p1!=NULL;p1=p1->next)
p1->stu->count_maexc();
for(p1=head;p1!=NULL;p1=p1->next)
p1->stu->count_mafal();
}
void Min_oper_Init_score()
{
Mod(6);
for(p1=head;p1!=NULL;p1=p1->next)
p1->stu->count_asfal();
}
void Admi_oper()
{
int h;
cout<<"\a---------------------Inout your operation---------------------\n";
cout<<" 1 Initial the students' base imformation.\n";
cout<<" 2 show the students' base imformation.\n"; //访问学生基本资料
cout<<" 3 Modify the student's base imformation.\n"; //修改学生基本资料
cout<<"Your answer is: ";
cin>>h;
cin.get();
cout<<"---------------------------------------------------------------\n";
switch(h)
{
case 1:
{
head=creat();
break;
}
case 2:
{
for(p1=head;p1!=NULL;p1=p1->next)
p1->stu->show();
break;
}
case 3:
{
Mod(1);
}
}
}
void Maj_oper()
{
int h;
cout<<"\a---------------------Inout your operation---------------------\n";
cout<<" 1 show the students' base and major subject imformation.\n"; //访问学生基本资料
cout<<" 2 Initial the student's major subject imformation.\n"; //初始化学生主修相关资料
cout<<" 3 modify the student's major subject imformation.\n"; //修改学生主修相关资料
cout<<"Your answer is: ";
cin>>h;
cin.get();
cout<<"---------------------------------------------------------------\n";
switch(h)
{
case 1:
{
for(p1=head;p1!=NULL;p1=p1->next)
p1->stu->show_maj();
break;
}
case 2:
{
Maj_oper_Init();
break;
}
case 3:
{
Mod(2);
break;
}
}
}
void min_oper()
{
int h;
char ch;
do
{
cout<<"\a---------------------Inout your operation---------------------\n";
cout<<" 1 show the students' base and minor subject imformation.\n"; //访问学生基本资料
cout<<" 2 Initial the student's minor subjects' name.\n"; //输入学生辅修科目名字
cout<<" 3 Initial the student's minor subject's score.\n"; //输入学生辅修科目分数
cout<<" 4 modify the student's minor subject imformation.\n"; //修改学生辅修相关资料
cout<<"Your answer is: ";
cin>>h;
cin.get();
cout<<"---------------------------------------------------------------\n";
switch(h)
{
case 1:
{
for(p1=head;p1!=NULL;p1=p1->next)
p1->stu->show_Fxco();
break;
}
case 2:
{
Mod(4);
break;
}
case 3:
{
Min_oper_Init_score();
break;
}
case 4:
{
Mod(3);
break;
}
}
cout<<"Do you want to modify the students' minor subject's imformation?\n";
cin>>ch;
}while(ch=='y');
}
void iden_and_oper()
{ int h;
char ch;
int i;
char pa[10];
head=NULL;
do
{
cout<<"---------------------Inout your position---------------------\n";
cout<<" 1 Admission staff.\n"; //招生办工作人员
cout<<" 2 Major subject staff.\n"; //主修系教务人员
cout<<" 3 Minor subject staff.\n"; //辅修系教务人员
cout<<" 4 Degree office staff.\n"; //学位办工作人员
cout<<"Your answer is: ";
cin>>h;
cin.get();
cout<<"---------------------------------------------------------------\n";
switch(h)
{
case 1:
{
cout<<"Input the password:"<<endl;
for(i=0;i<10;i++)
{
pa[i] = getch();
if(pa[i]=='\r') break;
printf("*");
}
pa[i]='\0';
if(strcmp(pa,"lumin")==0)
{
cout<<"\n";
Admi_oper();
}
else
cout<<"\nPassword is wrong!\n";
break;
getch();
}
case 2:
{
cout<<"Input the password:"<<endl;
for(i=0;i<6;i++ )
{
pa[i] = getch();
if(pa[i]=='\r') break;
printf("*");
}
pa[5]='\0';
if(strcmp(pa,"lumim")==0)
{
cout<<"\n";
Maj_oper();
}
else
cout<<"Password is wrong!\n";
break;
getch();
}
case 3:
{
cout<<"Input the password:"<<endl;
for(i=0;i<6;i++ )
{
pa[i] = getch();
if(pa[i]=='\r') break;
printf("*");
}
pa[5]='\0';
if(strcmp(pa,"lumib")==0)
{
cout<<"\n";
min_oper();
}
else
cout<<"Password is wrong!\n";
break;
getch();
}
case 4:
{
cout<<"Input the password:"<<endl;
for(i=0;i<6;i++ )
{
pa[i] = getch();
if(pa[i]=='\r') break;
printf("*");
}
pa[5]='\0';
if(strcmp(pa,"lumib")==0)
{
cout<<"\n";
Deg_oper();
}
else
cout<<"Password is wrong!\n";
break;
getch();
}
}
cout<<"Do you want to do anything else\n";
cin>>ch;
}while(ch=='y');
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -