#include
#include
#include
#include
#include
#include
The class student
{private:
, school char name [20] [30], grade [10], profession [10], sex [20].//name. School, grade, professional
Double cpro, English, math, sun, aver.//subject
Int the order, the age, number;//rank, age, student id
Public:
Student () {}
Student
(char n [20], char SCH [30], char gra [10], char se [20], int ag,
Char pro [10], int nu, double cc, double eng, double ma, double su, double av)
{strcpy (name, n);
Strcpy (school, SCH);
Strcpy (grade, gra); Strcpy (profession, pro);
Cpro=cc; English=eng; Math=ma; Strcpy (sex, se); Age=ag; Number=nu; Sun=su; Aver=av;
}
Friend void main ();
};
Void main ()
{
cout<" Welcome to make B * * * * * * student achievement management system!"
cout<" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "& lt;
Student * s [50];//pointer object, most save 50 students data
Ofstream * file [50];//is responsible for file insert
int i=0;
Int j=0;
Int flag=0;
Do//flag to judge whether the input effective
{
Cin> p;
If ((p>='0' & amp; & p<))
='7'flag=1;
The else
cout<" Command error! Please input again: "& lt;
Do {
Switch (p)//receiving options
{
Case '0' ://input data
{
char c;
, school char name [20] [30], grade [10], profession [10], sex [20].//name. School, grade, professional
Double cpro, English, math, sun, aver.//subject
Int the age, number;//rank, age, student id
Do {
cout<" Please input your name: ";
Cin> The name;
cout<" Please enter the student id: ";
Cin> Number;
cout<" Please enter the gender: ";
Cin> Sex;
cout<" Please enter the age: ";
Cin> The age;
cout<" Please enter the college: ";
Cin> school;
cout<" Please enter the grade: ";
Cin> grade;
cout<" Please enter the profession: ";
Cin> Profession;
cout<" Please enter the c + + grade: ";
Cin> Cpro.
cout<" Please input in English: ";
Cin> English;
cout<" Please enter the mathematics performance: ";
Cin> Math;
Sun=cpro + English + math;
Aver=sun/3;
cout
* the file [j] <" The name "& lt;
[I] s=new student (name, school, grade, sex, age, profession, number, cpro, English, math, sun, aver);
i++;
cout<" Data input is successful, want to continue to input (y/n) : ";
Cin> c;
cout
{
if(c! & amp;='y' & c!='n')
{
cout<" Command error! Please input again - -!"
}
The else
flag=1;
} while (flag==0);
} while (c=='y');
break;
}
Case '1' ://increase data
{
, school char name [20] [30], grade [10], profession [10], sex [20].
Int number, age;
Double cpro, English, math, sun, aver.
char c;
Do
{
cout<" ^. ^ to increase the student's name: please enter your ";
Cin> The name;
cout<" Please enter the student id: ";
Cin> Number;
cout<" Please enter the gender: ";
Cin> Sex;
cout<" Please enter the age: ";
Cin> The age;
cout<" Please enter the college: ";
Cin> school;
cout<" Please enter the grade: ";
Cin> grade;
cout<" Please enter the profession: ";
Cin> Profession;
cout<" Please enter the c + + grade: ";
Cin> Cpro.
cout<" Please input in English: ";
Cin> English;
cout<" Please enter the mathematics performance: ";
Cin> Math;
Sun=cpro + English + math;
Aver=sun/3;
cout
* the file [j] <" The name "& lt;