Home > Back-end >  [new turn] don't know how to solve this type of error
[new turn] don't know how to solve this type of error

Time:02-28

 
# include
# include
#include
using namespace std;

The class Employee
{
Public:
Void AddInfo (void);
Void ShowInfo (void);
Void DeleteInfo (void);
Void SearchInfo (void);
Void ChangeInfo (void);
Private:
Char No;
String Name;
Int the Age;
String Sex;
The string Section;
Static int Count;
The Employee * Pt;
};

Int the Employee: : Count=0;
Void the Employee: : AddInfo (void)
{
int n;
Cout<& lt;" Please enter a new number of employee information ";
Cin> n; CoutThe Count=n;
Pt=new Employee (Count);
for(int i=0; i{
Cout<& lt;" The first "& lt; Cin> Pt [I]. No;
Cout<& lt;" The first "\ n & lt; Cin> Pt [I]. Name;
Cout<& lt;" The first "\ n & lt; Cin> Pt [I] Sex;
Cout<& lt;" The first "\ n & lt; Cin> Pt [I] the Age;
Cout<& lt;" The first "\ n & lt; Cin> Pt [I] Section;
System (" CLS ");
}
}

Void ShowInfo (void)
{
Cout<& lt;" Employee information table "& lt; for(int i=0; iCout<& lt;" Working status: "& lt; }

Void DeleteInfo (void)
{
Int the no, I;
Cout<& lt;" Please input to delete the information of employees in working status: ";
Cin> No; Coutfor(i=0; iIf (Pt [I]. No==No)
{
For (int j=I + 1; JPt [1]=Pt [j];
}
}
The Count -;
}

Void SearchInfo (void)
{
Int the no, I;
Cout<& lt;" Please enter a query employees gonghaowu ";
Cin> No;
for(i=0; iIf (Pt [I]. No==No)
Cout<& lt;" Working status: "& lt; }
If (I=Count) {cout<& lt;" Input error! The job number does not exist "; }
}

Void ChangeInfo (void)
{
Int no, n.
Cout<& lt;" Please input to modify the information of employees in working status: ";
Cin> No; Coutfor(int i=0; iIf (Pt [I]. No==No)
{
Cout<& lt;" Please enter the Numbers choose to modify parts: 1. The name 2. 3. Gender age 4. The department ";
Cin> n;
The switch (n)
{
Case 1:
Cout<& lt;" Please input the revised name: ";
Cin> Pt [I]. Name;
Case 2:
Cout<& lt;" Please input the modified gender: ";
Cin> Pt [I] Sex;
Case 3:
Cout<& lt;" Please enter the age of the modified: ";
Cin> Pt [I] the Age;
Case 4:
Cout<& lt;" Please input the modified department: ";
Cin> Pt [I] Section;
break;
Default:
break;
}
}
}
Cout<& lt;" Modify success!" ;
}

Int main ()
{
Int Item;//operation command

The Employee e1;//

While (1)
{
cout cout cout <"2" output & lt; cout <"3 delete" & lt; cout <"Four search" & lt; cout <"Five changes" & lt; cout <"_______________________" & lt; cout <"Please select operation command:";
Cin & gt;> The Item;
System (" CLS ");//clear screen

The switch (Item)
{
Case 1://input information
{
E1. AddInfo ();
}
break;

Case 2://output information
{
E1. ShowInfo ();
}
break;

Case 3://delete information
{
E1. DeleteInfo ();
}
break;

Case 4://find information
{
E1. SearchInfo ();
}
break;

Case 5://modify information
{
E1. ChangeInfo ();
}
break;
Default:
break;
}
}
return 0;
}



C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (51) : error C2065: 'Count' : undeclared identifier
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2065: 'Pt: undeclared identifier
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2109: subscript requires an array or pointer type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2228: left of 'No' must have a class/struct/union type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2109: subscript requires an array or pointer type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2228: left of 'Name' must have a class/struct/union type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2109: subscript requires an array or pointer type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2228: left of 'Sex' must have a class/struct/union type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2109: subscript requires an array or pointer type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2228: left of 'Age' must have a class/struct/union type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2109: subscript requires an array or pointer type
C: \ Users \ 86139 \ \ Desktop \ personnel RRR CPP (52) : error C2228: left of 'Section' must have a class/struct/union type
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related