Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Kindly be sure to take in user input and store the 3 worker classes in an ArrayList Create a class Worker. Your Worker

In Java

Kindly be sure to take in user input and store the 3 worker classes in an ArrayList

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 three hourly workers (Use the scanner to input user information), creates an arraylist of 3 hourly worker objects, display the attributes and billing for each of the three hourly workers via output.. Display the worker name and billing amount for each worker and the total billing amount for all three.workers combined.

The output must be a printed version of ArrayList.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The World Wide Web And Databases International Workshop Webdb 98 Valencia Spain March 27 28 1998 Selected Papers Lncs 1590

Authors: Paolo Atzeni ,Alberto Mendelzon ,Giansalvatore Mecca

1st Edition

3540658904, 978-3540658900

More Books

Students also viewed these Databases questions