Can you tell me how to write the constructor for this?
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 (” ”).
Employee(string n,int i,string d ,string p) // n,i,d,p is the first letter of the variables
{
n = "Sam";
i = 123;
d = " ";
p = " ";
name(n);
idNumber(i);
department(d);
position(p);
}
// another version:
Employee(string n,int i,string d ,string p)
{
n = "Sam";
i = 123;
d = " ";
p = " ";
name = n;
idNumber = i;
department = d;
position = p;
}