Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How would I code this in Java? Im using Eclipse Photon. Please show output that it works and leave comments please. Thank you Create an

How would I code this in Java? Im using Eclipse Photon. Please show output that it works and leave comments please. Thank you image text in transcribed
image text in transcribed
Create an abstract Employee business class with these private instance variables: Employee number: Last name: First name: Email address: 1000-9999 numeric present present present Include two constructors, an empty constructor, and one that accepts all parameters, and a get and a set method for each of the instance variables. Include in this abstract class an abstract method called calcPay. The abstract method should accept a double parameter and return a double. You will also need to override the toString() method that will displays all the above fields in a formatted version (make it look nice). Create two subclasses that extend Employee, one for hourly employee, and one for salary employee. Both subclasses should override the abstract method in Employee. Hourly subclass: The hourly subclass should contain an instance variable for number of hours worked, two constructors that call the super class, and a get and set method for the instance variable. Hourly rate should be a constant that cannot be changed and set at 15.75. The calcPay method should accept the number of hours worked as the parameter, and calculate an hourly employee's pay by multiplying the number of hours worked by the hourly rate. Salary subclass: The salary subclass should contain an instance variable for yearly salary, two constructors that call the super class, and a get and set method for that instance variable. The calcPay method should accept a yearly salary as the parameter, and calculate a monthly salary by dividing the yearly salary by twelve months. The presentation class should ask for the employee number, last name, first name, email address and social security number. The presentation class's main method should consist almost entirely of method calls. Error checking should be done on all user-entered fields using a Validation class. Once the fields have been validated, those values should be passed to business class using the set methods. The application class should also ask if the employee is hourly or salary. Based on that answer; determine which calcPay method to call in order to calculate pay. If the employee is hourly, the application should prompt the user for the number of hours worked. That value should

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

Why isnt choosing a legal entity a one-time event?

Answered: 1 week ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 1 week ago

Question

Discuss the scope of financial management.

Answered: 1 week ago

Question

Discuss the goals of financial management.

Answered: 1 week ago