So I have an assigment where I need to create a class that stores 3 strings and an int for 3 employee data sets and then spits it all back out.
The instructor gave is weird instructions of the creation of the constuctors though
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.
I get the point of the first and last one, the first being the assign everything to its proper place and the second to reset everyhting for the next employee you have to enter... but I don't get the partial part of the middle one....
Heres my Employee.h:
#pragma once
#include <iostream>
#include <string>
using namespace std;
class Employee
{
private:
string name;
int idNumber;
string department;
string position;
public:
Employee()
{
name = " ";
idNumber = 0;
department = " ";
position = " ";
}
Employee (string eName, int eId, string eDepartment, string ePosition)
{
name = eName;
idNumber = eId;
department = eDepartment;
position = ePosition;
}