# include
# include
# include
//# include
//# include
# include
# include
using namespace std;
The class people {
Protected:
Char name [20].
Char sex [5].
Int number;
Public:
People ()
{
Strcpy (name, "");
Strcpy (sex, "");
Number=0;
}
Virtual void num ()=0;
};
The class student: public people
{
Private:
Int score [3].
Int total;
Int business;
Public:
Static int n;
Student (a);
/* void the add ();
Void the output ();
Void the find ();
Void the modify ();
Void does ();
Void the sort ();
Void the save ();
Void the load (); */
Virtual void num () {}
Student & amp; Operator=(const student & amp; T);
Friend cost & amp; Operator> (istream& Scin, student& S1);
Friend ostream & amp; Operator<(ostream& Scout, student& S2);
~ student () {}
The friend of the class the teacher;
};
Int student: : n=0;
The class the teacher: public people {
Private:
String tutor;
Public:
The teacher () : people ()
{
Cout<" * * * * * * * * * * please enter the name of the teacher's: * * * * * * * * * * * "& lt;
getchar();
}
Virtual void num ()
{
Cout<" Phone number: "& lt;
getchar();
}
Void the add ();
Void the output ();
Void the find ();
Void the modify ();
Void does ();
Void the sort ();
Void the save ();
Void the load ();
~ the teacher () {}
};
Student stu [100].
//int n=0;
Student: : student () : people ()
{
//strcpy (name, "");
//strcpy (sex, "");
For (int I; i<3; I++)
Score [I]=0;
Total=0;
Business=0;
}
Void the teacher: : add ()
{
Char flag='Y'
While (toupper (flag)=='Y')
{
Cin> [student: stu: n];
Student: : n++;
Cout<" To continue to add? (y/n) "& lt;
If (toupper (flag)! )
='Y'{
If (toupper (flag)=='N')
break;
The else
{
Cout<" Error, please enter again: "& lt;
}
}
}
}
Void the teacher: : the output ()
{
If (student: : n!=0)
Cout<" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - "& lt;
Cout
}
Void the teacher: : find ()
{
Int f3=0;
Char n1 [20].
Student temp.
Cout<" Please enter you will find the names of the people: "& lt;
for(int j=0; j
If (STRCMP (stu [j]. Name, n1)==0)
{
Temp=stu [j];
F3=1;
}
}
If (f3==0)
Cout<" I'm sorry to find student's result, without you "& lt;
Cout<" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "& lt;
{
Cout
}
}
}
Void the teacher: : modify ()
{
Int the f4=0;
Int t;
Char n2 [50];
Cout<" Input you want to modify the names of people: "& lt;
for(int j=0; j
If (STRCMP (stu [j]. Name, n2)==0)
{
T=j;
F4=1;
}
}
If (f4==0)
Cout<" I'm sorry, didn't you want to modify student achievement, "& lt;
{
Cout<" Please enter the student id: "& lt;
Cout<" Name: "& lt;
Cout<" Gender: "& lt;
Cout<" Results: higher mathematics "& lt;
Cout<" C + + grade: "& lt;
Cout<" English: "& lt;
Stu [t]. Total=0;
for(int i=0; i<3; I++)
Stu [t]. Total +=stu [t] score [I];
Stu [t]. Business=stu [t]. Total/3;
Cout<" Modify success!"
}
Void the teacher: : does ()
{
Char n3 [20].
Bool f5=0;
Char c;
Do {
Cout<" Please input you want to delete the names of the students: "& lt;
for(int i=0; i
If (STRCMP (n3, stu [I] name)==0)
{
F5=1;
Student: : n -;
Do {
Stu [I]=stu [I + 1);
i++;
} while (i
}
If (f5==0)
Cout<" You want to delete the object would not have been there!"
If (toupper (c)!='Y' | | toupper (c)!='N')
{
Cout