Question: CSci 112 - Computer Science II Spring 2021 Program 7 Programming Activity Create a new package named program7 in Eclipse (the project name can be

CSci 112 - Computer Science II Spring 2021 Program 7

Programming Activity

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 projectNewPackage, 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

ShiftSupervisor

- annualSalary : double - annualBonus : double

+ ShiftSupervisor(n : String, num : String, date : String, salary : double, bonus : double) : + setters + getters + getTotalPay() : double

+ toString( ) : String Contd on next page!!

1

Check the sample output below.

You need to export your programs to a zipped folder and submit in Blackboard (export the package program7 that contains 3 classes to one zipped folder, right-click on program7 packageExport). Click on Program 7 link in Bb, click Browse My Computer, attach the zip folder, and click Submit.

Sample Output

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 

2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!