#include
#include
using namespace std;//using namespace STD
//statement employees
The class Employee
{
Protected:
//to protect members
Int num.//number
String name;//name
Float basicSalary;//base pay
Float prize;//bonus
Public:
//the public function
The Employee (int nu, string na, float bs, float pr) : num (nu), name (na), basicSalary (bs), prize (pr) {}
Virtual void Show ()
{
Cout<& lt;" Number: "& lt;
Virtual void ShowSalary ()
{
Cout<& lt;" Real salary: "& lt;
};
Int main ()//the main function of the main ()
{
The Employee b [3]={Employee (106, "li Ming" 1, 1680, 1080), the Employee (107, "li Ming" 2, 1681, 1081), the Employee (10, "li Ming 3", 1682, 1082)};//p refer to rectangular object
Fstream f;
int x;
F.o pen (" Employee. TXT ", the ios: : out);
If (f.f ail ())
{
Cout<& lt;" Failed to open the file "& lt;
}
for(int i=0; i<3; I++)
{
F}
f.close();
F.o pen (" Employee. TXT ", the ios: : in);
If (f.f ail ())
{
Cout<& lt;" Failed to open the file "& lt;
}
while(! F.e of ())
{
F> x;
Cout
Cout
Cout & lt; <"Employee information:" & lt;
{//output tip
B [I] Show ();//output basic information
B [I] ShowSalary ();
}
}
CodePudding user response:
Are you going to be implemented in the employee class & lt;CodePudding user response:
The