Question: Need help. Please and thank you Develop a C++ program to create the following classes: (i)Employee: Each employee will have three data members: (i) Name
Need help. Please and thank you
Develop a C++ program to create the following classes: (i)Employee: Each employee will have three data members: (i) Name of string type, (ii) Emp UD (Employee ID) of integer type, (iii) Salary (annual salary) of Integer type. All the data members must be protected. It will have the following public member functions: Constructor with following parameters: A pointer to a string to initialize the Name of the employee - Integer to initialize the EmpID - Integer to initialize Salary DisplayEmp: Output the Name, Employee ID, Salary and Retirement Contributions in separate lines Output monthly gross salary of the employee by dividing Salary by 12 Output net Salary of the employee by subtracting retirement contribution from gross salary GetSalary: Returns the Salary of the Employee (ii) Customer: Each bank customer will have three data members: (i) Address of string type, (ii) Customer ID of integer type, (iii) Account Balance of double type. All the dat:a members must be protected. It will have the following public member functions Constructor with following parameters: A pointer to a string to initialize the Address of the customer Integer to initialize the CustomerID Integer to initialize AccountBalance Output the Customer ID, Address, and Salary and Account Balance in separate lines Returns the Account balance of the Customer (iii)Citizen: Inherits (Public inheritance) from Employee and Customer classes a. b. c. It has no additional data members Create member functions as needed Use the member functions of Employee and Customer classes Test your class by creating five different Citizen Objects (ask the user to input the data for the Citizen Objects) in the main function. Display Name, Address, Salary and Account Balance of the Citizen objects. Develop a C++ program to create the following classes: (i)Employee: Each employee will have three data members: (i) Name of string type, (ii) Emp UD (Employee ID) of integer type, (iii) Salary (annual salary) of Integer type. All the data members must be protected. It will have the following public member functions: Constructor with following parameters: A pointer to a string to initialize the Name of the employee - Integer to initialize the EmpID - Integer to initialize Salary DisplayEmp: Output the Name, Employee ID, Salary and Retirement Contributions in separate lines Output monthly gross salary of the employee by dividing Salary by 12 Output net Salary of the employee by subtracting retirement contribution from gross salary GetSalary: Returns the Salary of the Employee (ii) Customer: Each bank customer will have three data members: (i) Address of string type, (ii) Customer ID of integer type, (iii) Account Balance of double type. All the dat:a members must be protected. It will have the following public member functions Constructor with following parameters: A pointer to a string to initialize the Address of the customer Integer to initialize the CustomerID Integer to initialize AccountBalance Output the Customer ID, Address, and Salary and Account Balance in separate lines Returns the Account balance of the Customer (iii)Citizen: Inherits (Public inheritance) from Employee and Customer classes a. b. c. It has no additional data members Create member functions as needed Use the member functions of Employee and Customer classes Test your class by creating five different Citizen Objects (ask the user to input the data for the Citizen Objects) in the main function. Display Name, Address, Salary and Account Balance of the Citizen objects
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
