Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java 1. An Employee class maintains the information for a number of employees. The data describing each employee consists of name, age, and weekly_income. The
Java
1. An Employee class maintains the information for a number of employees. The data describing each employee consists of name, age, and weekly_income. The constructor method should accept the name and age as parameters. Methods should be provided to get and set both name and age. There are two types of employees: Part_time and Full_time. Part_time Employee's weekly_income = num_hrs x rate_hr. Make num_hrs and rate_hr as members of the class Part_time. Implement both get_wk_income and set_wk_income methods. Full_time Employee's weekly income = num_yrs_services x factor where factor is 1000. Make num_ yrs services and factor as members of the class Full_time and declare factor as a constant integer. Implement both get wk_income and set wk income methods. Set up classes Employee, Part_time and Full_time with maximum use of inheritance. Implement class EmployeeDemo to test your program (get: read set: write). (14\%) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started