Home > Back-end >  help
help

Time:03-23

Define a Student class Student, the main () function to finish the test,

# # # Student class structure elucidation:

Student class data members include:
(1) private data members: student id no (char []), the name name (char []), age, the age (int),
(2) the static data members: sum (int), the role for the current moment the total number of Student class object,

Student class member functions include:
(1) define and constructor Student (char *, char *, int) and copy constructor Student (Student & amp;) , including arguments Constructor parameter defaults to an empty string, or zero (when the string is NULL to deal with it as an empty string), output information Constructor "run", the copy Constructor output information "CopyConstructor run"
(2) define the Destructor, the Destructor output information "Destructor run"
(3) members of the public function: void setNo (char *) and char * getNo () returns and set no (when parameter to NULL to deal with it as an empty string)
(4) members of the public function: void elegantly-named setName (char *) and char * getName () returns and set the name (when parameter to NULL to deal with it as an empty string)
(5) members of the public function: void setAge (int) and int getAge () returns and set the age
Those members of the public function: the void show () is used to display the current object information age, assume that "student id=20190327, name=doublebest, age=21" students object information display format is as follows:
No: 20190327, Name: doublebest, Age: 21
The referee sample testing program:
# include
using namespace std;

Please fill in the answer here

Int main () {
Char s1 [10]="20190327";
Char s2 [20]="doublebest";
Student stu1 (s1, s2);
Stu1. SetAge (21);
Stu1. The show ();
Student stu2=stu1;
Cin. Getline (s1, 10, '\ n');
Cin. Getline (s2, 20, '\ n');
Stu2. SetNo (s1);
Stu2. Elegantly-named setName (s2);