Create a class named Employee. The class should store the following information.
ID: 3658386 • Letter: C
Question
Create a class named Employee. The class should store the following information. first name last name employee number Create a class named HourlyEmployee that inherits from the Employee class. This class should store the following additional pieces of information: shift ( "days" OR "swings" OR "mids" ) hourly rate Create a class named SalaryEmployee that inherits from the Employee class. This class should store the following additional information: Yearly salary For all three of the classes: all fields should be declared to have private access all fields should have accessor ( get ) and mutator ( set ) methods there should be a single constructor that requires values for ALL of the fields in the class ( and for its superclass ) there should be a toString method that displays a formatted mini report including ALL of the fields of the class ( including any in the superclass ) Create a test class called TestEmployeeClasses Create 1 object of each class: Employee, HourlyEmployee, and SalaryEmployee Prompt the user of your program ( AFTER displaying a description of your program firstExplanation / Answer
This code below includes Employee class..... public class Employee { private double currentSalary; private double newSalary; private java.lang.String name; public Employee() { name = "Last, First"; currentSalary = 0; } public Employee (String n) { name = n; } public String getName() { return name; } public double getSalary() { return currentSalary; } public Employee (String n, double cs) { name = n; currentSalary = cs; } public void raiseSalary (double byPercent) { double newSalary = currentSalary * (1 + (byPercent/100)); } public String toString() { String str = ""; str = "Name: " + name + " The salary of the employee is " + currentSalary + " The empoyee's salary after the raise is " + ; return str; }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.