Question
Please, I need this program by tomorrow along with *a lot* of other programs and work. Please help.
2. Employee Class
Write a class named Employee that has the following member variables:
VideoNote
Solving the
Employee
Class Problem
name. A string that holds the employee s name.
idNumber. An int variable that holds the employee s ID number.
department. A string that holds the name of the department where the employee
works.
position. A string that holds the employee s job title.
The class should have the following constructors:
A constructor that accepts the following values as arguments and assigns them to
the appropriate member variables: employee s name, employee s ID number,
department, and position.
A constructor that accepts the following values as arguments and assigns them to
the appropriate member variables: employee s name and ID number. The
department and position fields should be assigned an empty string ( "" ).
A default constructor that assigns empty strings ( "" ) to the name , department ,
and position member variables, and 0 to the idNumber member variable.
Write appropriate mutator functions that store values in these member variables and
accessor functions that return the values in these member variables. Once you have
written the class, write a separate program that creates three Employee objects to
hold the following data.
Please follow the instructions in the question to write codes. Credits will not be given if codes do not use class or do not follow the instructions in the question. (need 3 Constructors, mutator functions, main function).
Explanation / Answer
#include #include using namespace std; class Employee { private: string Name; int IdNumber; string Department; string Position; public: Employee(string AssignName,int AssignIdNumber,string AssignDepartment,string AssignPosition) { Name=AssignName; IdNumber=AssignIdNumber; Department=AssignDepartment; Position=AssignPosition; } Employee(string AssignName,int AssignIdNumber) { Name=AssignName; IdNumber= AssignIdNumber; Department=""; Position=""; } Employee() { Name=""; IdNumber=0; Department=""; Position=""; } string getName() const; int getIdNumber() const; string getDepartment() const; string getPosition () const; }; string Employee::getName() const { return Name; } int Employee::getIdNumber() const { return IdNumber; } string Employee::getDepartment() const { return Department; } string Employee::getPosition() const { return Position; } finally got the file to open i think i no longer get that error now these are the errors i get: error C2065: 'employeedata' : undeclared identifier error C2146: syntax error : missing ';' before identifier 'EMPLOYEE' error C2065: 'EMPLOYEE' : undeclared identifier error C2059: syntax error : '{' error C2143: syntax error : missing ';' before '{' error C2143: syntax error : missing ';' before '}' error C3861: 'employeedata': identifier not found error C3861: 'employeedata': identifier not found error C3861: 'employeedata': identifier not found error C2065: 'EMPLOYEE' : undeclared identifier C2228: left of '.getName' must have class/struct/union error C2065: 'EMPLOYEE' : undeclared identifier error C2228: left of '.getIdnumber' must have class/struct/union error C2065: 'EMPLOYEE' : undeclared identifier error C2228: left of '.getDepartment' must have class/struct/union error C2065: 'EMPLOYEE' : undeclared identifier error C2228: left of '.getPosition' must have class/struct/union