Week Employee Class
Week Employee Class
#include <string>
using namespace std;
class Employee
{
private:
string name; // Holds the employee's name
int idNumber; // Holds the employee's ID number
string department; // Holds the department where the employee works
string position; // Holds the employee's job title
public:
// This constructor initializes all fields (name, ID, department, position).
Employee(string empName, int empId, string empDept, string empPos)
{
name = empName;
idNumber = empId;
department = empDept;
position = empPos;
}
// This constructor initializes only the name and ID, leaving department and position empty.
Employee(string empName, int empId)
{
name = empName;
idNumber = empId;
department = "";
position = "";
}
int main()
{
// Create three Employee objects with the required data.
Employee emp1("Susan Meyers", 47899, "Accounting", "Vice President");
Employee emp2("Mark Jones", 39119, "IT", "Programmer");
Employee emp3("Joy Rogers", 81774, "Manufacturing", "Engineer");
return 0;
}