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:

  • a default constructor
  • 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.

Here what the Address Header File (Address.h) will have:

  • a default constructor
  • 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 function: it prints the Street, City, State, and Zip.

Here what the 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.

Implement the Employee class using the constructor as an external function:

  • 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
  • Remember that the default constructor for Address has the following initial values: Address to "99999 Sunset Boulevard" , "Beverly Hills", "CA", "99999"
  • 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 e using the printEmployee().

Also you need to decclare:

  • 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 compile the Employee.cpp file and execute it to verify the output:

Employee e:
John H. Doe
99999 Sunset Boulevard" , Beverly Hills, CA, 99999
xxx-xx-xxxx

Employee e1:

George Victor Meghabghab

your own address

987-65-4321
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.