Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I accep values for the month greater than 12 or less than 1. D Dalues for the da

ID: 3740644 • Letter: I

Question


I accep values for the month greater than 12 or less than 1. D Dalues for the day greater than 31 or less than 1. Do 2. Employee Class Write a class named Employee that has the following member varia name. A string that holds the employee's name. idNumber. An int variable that holds the employee's ID nu department. A string that holds the name of the department where the employee mber 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 construc tor that accepts the following values as arguments and assigns them to the appropriate member variables: employee's name and I 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.

Explanation / Answer

Note : Please find class under below.....run it on any ide or complier with proper naming......if any queries pleae revert back in comment box.....i think your requirement fulfilled.....

/////////////////////////////////////////////////////////////////////////////////START////////////////////////////////////////////////////////////////////////

#include <iostream>
#include<string>
using namespace std;

class Employee
{
private:
int IdNumber;
string name,department,position;

public:
Employee(){
IdNumber=0;
}
void employee(int Id,string Name,string Department,string Position)
{
IdNumber=Id;
name=Name;
department=Department;
position=Position;
}
void employee(int Id,string Name){
IdNumber=Id;
name=Name;
department="";
position="";
}
void PrintDetails(string details){
cout << details << " " << "IdNumber: " << IdNumber << " " << "name: " << name << " " << "department: " << department << " " << "position: "<< position << " " << " " ;
}
};

int main()
{
Employee emp1,emp2,emp3;
emp1.employee(47899,"Susan Meyers","Accounting","Vice President");
emp1.PrintDetails("Employee1_Details");
emp2.employee(39119,"Mark Jones","IT","Programmer");
emp2.PrintDetails("Employee2_Details");
emp3.employee(81774,"Joy Rogers","Manufacturing","Engineer");
emp3.PrintDetails("Employee3_Details");
return 0;
}

//////////////////////////////////////////////////////////////////////////////END////////////////////////////////////////////////////////////////////////////////