Create a C++ class called Employee which will implement the Employee constructor. Remember that once the Name of the Employee is entered and the Address of the Employee is entered, once you add an SSN you are ready to create an employee.
Here what the Name Header file (Name.h)will have:
1-a default constructor
2- 3 private string instance variables for :First Name, Middle Name, and a last Name
3- getFirstLast function: it returns the first and middle name and last name in order
4-print function: it prints the first, middle, and last name.
Here what the Address Header File (Address.h) will have:
1-a default constructor
2- 4 private string instance variables for :Street, City, State, Zip
3-getCity: it returns the City
4-getState: It returns the State
5-getStreet: It returns the street
6-getZip: it returns the zip
7-print function: it prints the Street, City, State, and Zip.
Here what the Employee Header File (Employee.h) will have:
1- 3 private instance variables: One for Name (Use the Header Name from above), One for The Address
(Use the Address Header from above), a string variable for the SSN.
2- a default constructor which initializes the SSN to "999-99-9999", Name to "John H. Doe", Address to
"99999 Sunset Boulevard" , "Beverly Hills", "CA", "99999"
3-a constructor with 3 parameters
4-getName function: it returns the Name of the Employee
5-getAddress function : it returns the address of the Employee.
6- getSSN function: it returns the SSN as a string
7- print function: Prints the name, prints the Address, prints the SSN.
Implement the Employee class using the constructor as an external function:
1- Remember that the default constructor for Employee has the following initial values:
SSN to "999-99-9999", Name to "John H. Doe", Address to "99999 Sunset Boulevard" ,
Beverly Hills, CA, 99999
2- Remember that the default constructor for Address has the following initial values:
Address to "99999 Sunset Boulevard" , "Beverly Hills", "CA", "99999"
3- Remember that the default constructor for Name has the following initial values:
Name to "John H. Doe",
In the void main() function you would declare:
a Name n;
an Address A;
and an Employee e;
and print the values of each.
Remember to drop the following files in the drop box:
- Name.h
- Address.h
- Employee.h
- Employee.cpp
Remember to compile the Employee.cpp file and execute it to verify the output:
Name:
John H. Doe
Address:
9999 Sunset Boulevard" , Beverly Hills, CA, 99999 (Address)
Employee:
John H. Doe
99999 Sunset Boulevard" , Beverly Hills, CA, 99999
xxx-xx-xxxx