Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Create a new package named program7 in Eclipse (the project name can be 112 or whatever you have), and put all the classes

In Javaimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Create a new package named program7 in Eclipse (the project name can be 112 or whatever you have), and put all the classes in this package (right-click on a project New Package, type program7 as the package name). Design a class named Employee. The class should keep the following information in fields: Employee name (String) Employee number (String) Hire date (String) Write a constructor, setters, and getters, and toString method for the class. Next, write a class named ShiftSupervisor that extends the Employee class. The ShiftSupervisor class should have fields to hold the following information: Annual salary (a double) Annual production bonus (a double) Write a constructor, setters, and getters, getTotalPay (which is salary + bonus), and toString method for the class. Below is a UML diagram that shows possible class designs and the relationship between the two classes. Once you have written these two classes, use them in an application SupervisorDemo that can be downloaded (SupervisorDemo.java) from this program on Bb. When you run the driver program, you should get the output as shown on the next page. Employee - name : String - employeeNumber : String - hireDate : String + Employee(n : String, num : String, date : String): + setters + getters + toString(): String Shift Supervisor - annualSalary: double - annualBonus : double + Shift Supervisor(n : String, num : String, date : String, salary: double, bonus : double): + setters + getters + getTotalPay(): double + toString(): String Cont'd on next page!! Enter employee name: David Smith Enter employee number: 12345 Enter hire date: 10-15-2020 Enter annual salary: 85000 Enter annual bonus: 4455 Here's the shift supervisor info: Employee Name: David Smith Employee Number: 12345 Hire Date: 10-15-2020 Annual Salary: $85000.00 Annual Bonus: $4455.00 Total Pay: $89455.00 import java.util.Scanner; public class SupervisorDemo { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print("Enter employee name: "); String name = scan.nextLine(); System.out.print("Enter employee number: "); String number = scan.nextLine(); System.out.print("Enter hire date: "); String date = scan.nextLine(); System.out.print("Enter annual salary: "); double salary = scan.nextDouble(); System.out.print("Enter annual bonus: "); double bonus = scan.nextDouble(); // Create a Shift Supervisor object //WRITE a line of code here ...pay attention to the system.out.println below what did I put in there? // Display the data System.out.println(" Here's the shift supervisor info: "); System.out.println(ss); } }

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What reactive strategies might you develop?

Answered: 1 week ago

Question

What is management growth? What are its factors

Answered: 1 week ago