?//Input from the keyboard Input () personnel information;
? The Display ()//output personnel information;
___________,//a no-parameter constructor, the initial value for (li ling, 22, sichuan);
____//arguments constructor (three parameters); ____//destructor;
? Elegantly-named SetName (?)//set the name?
SetProvince (?)//set the provinces?
SetScore (?)//set?
GetName (?)//getting the names of the encapsulated in class? GetProvince (?)//get classes encapsulate provinces? GetScore (?)//get class encapsulates the result per1 fires our main function requirements: (1) the definition object, successively call Display (), Input (), Display () function
(2) through a call to the Set.. () function, update object per1 fires our respectively the value of the three data members, through the call Get.. () function shows the updated data (3) define the object per2, initialized using the constructor with parameters (for receiving data on the user's input from the keyboard as a parameter), call Display () function
(4) define the object these forms, initialized to per2 references to call Display () function
(5) defined object pointer q point to per1 fires our, through q call Display () function, GetName function
(6) to define an object array p [4], calls to the Input () function to complete three four object attribute data Input, call GetProvince () function to complete the output of the object of four provinces, the output format is as follows:
Four objects in the province are:
Sequence number province
1
in jiangsuZhejiang
23 hunan
4 in heilongjiang province
CodePudding user response:
For the novice operations non-inductive,