Create a class employee which has three private class


Create a class Employee, which has three private class variables (Name, Address, PhoneNumber), access methods to get and set each of these properties, and two constructors (one 0-argument constructor and the second setting property values to specific values passed to the constructor).

Create a class SalaryEmployee, which extends Employee and adds one more property (Salary) with proper set and get methods. Add one more method ByWeeklyPay of type double.

Create a class HourlyEmployee, which extends Employee and adds two more properties (HourWage and HoursWorked) with relevant get and set methods. Add one more getPayAmount method.

Create a class UseEmployee, which will instantiate objects of each of the classes above (Employee, SalaryEmployee, HourlyEmployee) with particular values (take any values of the proper data type) and display the information on all properties of an Employee object created, a SalaryEmployee object created, and an HourlyEmployee object created.

Compile, run, and check the results. Submit the following:

1.The source file (If more than one file has been created, zip them into one .zip file for posting.)

2.The UML class diagram illustrating class hierarchy

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Create a class employee which has three private class
Reference No:- TGS0918310

Now Priced at $30 (50% Discount)

Recommended (98%)

Rated (4.3/5)