Question
In Java Create a class Worker. Your Worker class should include the following attributes as String variables: Name, Worker ID, Worker Address, Worker City, Worker
In Java
Create a class Worker. Your Worker class should include the following attributes as String variables:
Name, Worker ID, Worker Address, Worker City, Worker State
Create the constructor that initializes the above worker attributes.
Then make another class name HourlyWorker that inherits from the Worker class. HourlyWOrker has to use the inherited parent class variables and add in hourlySalary and billableHours. Your HourlyWorker class should contain a constructor that calls the constructor from the Worker class to initialize the common instance variables but also initializes the hourlySalary and billableHours. Next create a billing method to HourlyWorker that will calculate the amount due.
FInally, create a test class that prompts the user for the information for five hourly workers (Use the scanner to input user information), creates an arraylist of 5 hourly cworker objects, display the attributes and billing for each of the five hourly workers. Display the worker name and billing amount for each worker and the total billing amount for all five .workers combined.
.
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