Create a C++ class called Employee which will implement the Employee constructor
ID: 3670224 • Letter: C
Question
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.
*** I am mainly confused about the requirements listed in Employee.cpp
Name Header file (Name.h) will have:
A default constructor. Remember that the default constructor for Name has the following initial values: Name to "John H. Doe".
3 private string instance variables for :First Name, Middle Name, and a last Name
getFirstLast() function: it returns the first and middle name and last name in order
printName() function: it prints the first, middle, and last name.
Address Header File (Address.h) will have:
A default constructor. Remember that the default constructor for Address has the following initial values: Address to "99999 Sunset Boulevard" , "Beverly Hills", "CA", "99999"
4 private string instance variables for :Street, City, State, Zip
getCity(): it returns the City
getState(): It returns the State
getStreet(): It returns the street
getZip(): it returns the zip
printAddress(): it prints the Street, City, State, and Zip.
Employee Header File (Employee.h) will have:
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.
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"
a constructor with 3 parameters: One for Name, one for Address, a string for SSN.
getName() function: it returns the Name of the Employee
getAddress() function : it returns the address of the Employee.
getSSN() function: it returns the SSN as a string
printEmployee() function:
print the name: Make sure you use the printName() function from Name.h
print the address: Make sure you use the printAddress() function from Address.h
prints the SSN.
Employee (Employee.cpp) class will have:
In the void main() function you would declare:
a Name n;
an Address A;
and an Employee e;
and print e using the printEmployee().
****Also you need to declare:
A Name n1: George Victor Meghabghab
an Address a1: your own address
string ssn1: 987-65-4321
An employee e1 which has a name n1, and address A1, and ssn1.
Print e1 using printEmployee().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:
Employee e:
John H. Doe
99999 Sunset Boulevard" , Beverly Hills, CA, 99999
999-99-9999
Employee e1:
George Victor Meghabghab
your own address
987-65-4321
Explanation / Answer
---------------------------------------------------------------
--------Employee.h-----------
------------------------------------------------------------------Employee.cpp
--------------------------------------------------