Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Objectives: The focus of this assignment is the use of inheritance, abstract cla

ID: 3668547 • Letter: O

Question

Objectives: The focus of this assignment is the use of inheritance, abstract classes and multiple class files. You will need to understand and implement the concepts of basic inheritance, polymorphism, and abstraction.

Program Description:

Building upon the examples shown in class and in the text, this project will store a basic list of employees for a company. Options for updating the list and updating the individual employees stored in the list will be provided by the program.

A total of seven classes are required for this program.

Employee – An abstract class which the other employee types inherit

HourlyEmployee – An employee whose pay is based upon an hourly wage and hours worked

SalaryEmployee – An employee whose pay is based upon a yearly salary

CommissionEmployee – An employee whose pay is based upon a commission rate and sales amount

EmployeeList – A class that contains an array of Employees and provides utilities to manage the list (array) of Employee objects, and each Employee stored within the list (array)

Menu – A class used to display a menu, read and validate the option chosen by the user, and return the item number to the caller. This class is provided to you and must NOT be changed.

EmployeeDriver – Contains the main method. This class creates an EmployeeList object as well as the menu objects in order to test the EmployeeList and the Employee classes. This class is provided to you and must NOT be changed. Note: You do not need to add your to the class names for this program.

Details for each class are provided below.

File/Class 1 – Employee

This class is an abstract base class used to define the common attributes and methods for all employee subclasses.

UML DIAGRAM FOR AND DISCUSSION FOR Employee

Note: ‘#’ indicates ‘protected’ access in the UML diagram.

Employee {abstract}

# firstName : String

# lastName : String

# fulltime : Boolean

# gender : Character

# employeeNum : Integer

<<constructor>> Employee (first : String, last : String, gen : Character ,

empNum : Integer, full : Boolean )

+ getEmployeeNumber() : Integer

+ setEmployeeNumber(empNum : Integer)

+ getFirstName() : String

+ getLastName() : String

+ toString() : String

+ calculateWeeklyPay() : Double {abstract}

+ annualRaise() {abstract}

+ holidayBonus() : Double {abstract}

+ resetWeek() {abstract}

Note: We are not implementing the ‘get’ and ‘set methods for all data members for this class – only implement the ‘get’ and ‘set’ methods shown in the above UML diagram.

DISCUSSION OF CLASS Employee:

Attributes

firstName – Protected – first name of the employee lastName – Protected – last name of the employee

fulltime – Protected – true of employee is a fulltime employee / false if not a fulltime employee gender – Protected – If the gender is invalid, default to ‘F’ (valid values are ‘M’ or ‘F’) employeeNum – Protected – employee number

Methods

<<constructor>> Employee (first : String, last : String, gen : Character,

empNum : Integer, full : Boolean )

Stores the first name, last name, employee number and fulltime value based on the values passed to the constructor. If the gender value is not ‘M’ or ‘F’, default the gender to ‘F’.

getEmployeeNumber, getFirstName, getLastName Methods- Return the value stored in the corresponding attribute setEmployeeNumber (empNum : Integer) – Allows the employeeNum to be changed

Validate the employee number is greater than zero.

If the value of empNum is not greater than zero, do not change the value stored in employeeNum attribute

toString() – Overrides the Object toString() method. Use String.format to returns a String copy of the Employee object in a format similar to the following format:

Number: 1234   Name: Vlasnik, Sandy   Gender: F   Status: Part Time

calculateWeeklyPay() – Abstract method to be implemented by each subclass. Calculates pay for the week.

annualRaise() – Abstract method to be implemented by each subclass.

Gives the Employee a raise.

holidayBonus() – Abstract method to be implemented by each    subclass.

Calculates bonus for the Employee.

resetWeek() – Abstract method to be implemented by each subclass.

Resets the weekly values for the Employee.

File/Class 2 – HourlyEmployee

This class is a concrete class defining the attributes and methods specific to an hourly employee. This class extends the base class Employee and implements the abstract methods declared in the Employee abstract class.

UML DIAGRAM FOR AND DISCUSSION FOR HourlyEmployee

HourlyEmployee extends Employee

wage : Double

hoursWorked : Double

<<constructor>> HourlyEmployee (first : String, last : String,

gen : Character, empNum : Integer, full : Boolean, hWage : Double)

+ toString() : String

+ addWorkHours (Double hours)

+ calculateWeeklyPay() : double

+ annualRaise()

+ holidayBonus() : double

+ resetWeek()

DISCUSSION OF CLASS HourlyEmployee:

Private Data Members:

Double wage – hourly wage earned by the employee

Double hoursWorked – number of hours worked by the employee – initialized to zero

Methods

<<constructor>> HourlyEmployee (first : String, last : String, gen : char,

empNum : int, full : Boolean, hWage : Double)

Call the constructor of the base class Employee using ‘super’ and set the wage and hoursWorked using the values passed as parameters.

hoursWorked should be zero (0) when the class is instantiated.

toString() – Overrides object method toString(), returns a String of the HourlyEmployee in a format similar to the following format (note that you must use the “super.toString()” method to format the first six values):

Number: 1234   Name: Vlasnik, Sandy     Gender: F   Status: Part Time Wage:      $10.00

Hours Worked: 0.00

addWorkHours(Double hours) – Increase the hoursWorked by the number of hours passed in the parameter ‘hours’. If the value passed in hours is negative, display an error message and do not modify the value stored in hoursWorked.

Abstract method implementations:

calculateWeeklyPay() – Calculate and return the amount earned in the week using wage and hoursWorked. For any hours worked over 40 hours, pay those hours at 1.5 * the hourly wage.

annualRaise() – Increase the wage by 5%

holidayBonus() – The holiday bonus for an hourly employee is their wage * 40 hours. Return the result of this calculation. resetWeek() – Resets hours worked to 0

File/Class 3 – SalaryEmployee

This class is a concrete class defining the attributes and methods specific to a salary type employee. This class extends

the base class Employee and implements the abstract methods declared in the Employee abstract class.

UML DIAGRAM FOR AND DISCUSSION FOR SalaryEmployee

SalaryEmployee extends Employee

-     salary : Double

<<constructor>> SalaryEmployee (first : String, last : String,

gen : Character, empNum : Integer, full : Boolean, sal : Double )

+ toString() : String

+ calculateWeeklyPay() : double

+ annualRaise()

+ holidayBonus() : double

+ resetWeek()

DISCUSSION OF CLASS SalaryEmployee:

Additional Data Members

-     Double salary : Private data member to store the annual salary amount

Methods

<<constructor>> SalaryEmployee (first : String, last : String, gen : char,

empNum : int, full : Boolean, sal : Double)

Call the constructor of the base class Employee using ‘super’ and set the salary using the value passed as a parameter.

toString() – Overrides object method toString(), returns a String of the SalaryEmployee in EXACTLY the following format (note that you must use the “super.toString()” method to format the first six values):

Number: 1234 Name: Vlasnik, Sandy Gender: F Status: Part Time Salary:              $80,000.00

Abstract method implementations:

calculateWeeklyPay() – Calculate and return the amount earned in one week – (divide the salary by 52.0) annualRaise() – Increase the salary amount by 5%

holidayBonus() – The holiday bonus earned by a salaried employee is 5% of the annual salary. Return 5% of the current salary

resetWeek() – No changes required to attributes. Add opening and closing curly braces for this method. No values need to be reset for this type of employee.

File/Class 4 – CommissionEmployee

This class is a concrete class defining the attributes and methods specific to a commission type employee. This class

extends the base class Employee and implements the abstract methods declared in the Employee abstract class.

UML DIAGRAM FOR AND DISCUSSION FOR CommissionEmployee

CommissionEmployee extends Employee

sales : Double

rate : Double

<<constructor>> CommissionEmployee (first : String, last : String,

gen : Character, empNum : Integer, full : Boolean, cRate : Double )

+ toString() : String

+ increaseSales (amt : Double)

+ calculateWeeklyPay() : Double

+ annualRaise()

+ holidayBonus() : Double

+ resetWeek()

DISCUSSION OF CLASS CommissionEmployee:

Additional Data Members

Double sales – the sales amount for the week

Double rate – the commission rate earned stored as a floating point value, for example 3.5% would be stored as .035

Methods

<<constructor>> CommissionEmployee (first : String, last : String, gen : char,

empNum : int, full : Boolean, cRate : Double)

Call the constructor of the base class Employee using ‘super’ and set the rate using the value passed as a parameter. ‘sales’ should be set to 0 initially.

Set the ‘rate’ equal to cRate/100.0 (the user should enter the value as a percentage – 3.5% would be entered as 3.5.

toString() – Overrides object method toString(), returns a String of the SalaryEmployee in EXACTLY the following format (note that you must use the “super.toString()” method to format the first six values) Note: rate should be shown as the ‘rate * 100.0’ followed by a % symbol: Note: To print a ‘%’ symbol using String.format, use “%%” in the format control string. Example: String.format (“value: = %.2f%%”, theValue);

Number: 1234

Name: Vlasnik, Sandy

Gender: F   Status: Part Time

Rate:

3.50%

Sales:

$0.00

increaseSales (amt : Double) - Increase the sales amount by amount passed in the parameter ‘amt’. If the value passed in ‘amt’ is negative, display an error message and do not modify the value stored in ‘sales’.

Abstract method implementations:

calculateWeeklyPay() – Calculate and return the amount earned in one week by multiplying the sales amount and the rate

annualRaise() – Increase the commission rate by 4%. If the initial ‘rate’ was 3.0%, the new rate would be 7.0% (stored as .07)

holidayBonus() – The holiday bonus earned by a commissioned employee is 0 dollars. resetWeek() – Set the sales amount to 0.0.

File/Class 5 –EmployeeList

This class creates an array of Employee objects and uses various methods to manipulate each Employee stored in the array.

UML DIAGRAM FOR AND DISCUSSION FOR EmployeeList

EmployeeList

EMPLOYEES_MAX = 50 : Final Integer

employees : Employee[]

numEmployees : Integer

<<constructor>> EmployeeList ()

getIndex (empNum : Integer) : Integer

listAll ()

listHourly ()

listSalary ()

listCommission ()

increaseHours (index : Integer, amount : Double)

increaseSales (index : Integer, amount : Double)

addEmployee (empType : Integer, first: String, last: String, gen: Character, empNum : Integer, full : Boolean, amount: Double) : Boolean

removeEmployee (index : Integer)

sortByEmpNumber ()

sortByLastName ()

holidayBonuses () : Double

annualRaises ()

calculatePayout () : Double

resetAllWeeks ()

DISCUSSION OF CLASS EmployeeList:

Data Members

employees : Employee[] – An array of EMPLOYEES_MAX Employee objects

EMPLOYEES_MAX = 50 : Final Integer – the maximum number of Employee objects that may be stored in the array ‘employees’

numEmployees : Integer – the number of Employee objects currently stored in the array.

Methods

<<constructor>> EmployeeList ()

Allocate the array ‘employees’ to store EMPLOYEES_MAX Employee objects.

Example:

employees = new Employee[EMPLOYEES_MAX];

getIndex (empNum : Integer) : Integer

Return the array index of the employee with the matching empNum

Hint: Use a loop to traverse the ‘employees’ array until you find a matching employee number or until you have compared all the employees currently stored in the array.

o You will need to call the getEmployeeNumber method for the employee stored in the current position of the array (assuming ‘x’ is your loop counter):

if (employees[x].getEmployeeNumber() == empNum) // match found – return x

If no employee exists in the employees array with the matching employee number, return -1

listAll ()

Display each employee currently stored in the array ‘employees’.

Note that you do not need to know the type of employee stored in each array position. Call the toString() method for the array element. Using polymorphism, Java will call the correct toString() method based on the type of the employee object stored in the element.

Example:

for (int x = 0; x < numEmployees; x++) System.out.println (employees[x]);

listHourly ()

Display only the employees of type HourlyEmployee stored in the array ‘employees’. You will need to use the ‘instanceof’ operator to determine the type of object stored in the array position.

listSalary ()

Display only the employees of type SalaryEmployee stored in the array ‘employees’. You will need to use the ‘instanceof’ operator to determine the type of object stored in the array position.

listCommission ()

Display only the employees of type CommissionEmployee stored in the array ‘employees’. You will need to use the ‘instanceof’ operator to determine the type of object stored in the array position.

increaseHours (index : Integer, amount : Double)

If the employee stored in the array ‘employee’ at position ‘index’ is an instance of the HourlyEmployee, increase this employee’s hours by the amount provided.

increaseSales (index : Integer, amount : Double)

If the employee stored in the array ‘employee’ at position ‘index’ is an instance of the CommissionEmployee, increase this employee’s sales by the amount provided.

addEmployee (empType : Integer, first: String, last: String, gen: Character,

empNum : Integer, full : Boolean, amount: Double) : Boolean

If the array is full – print an error message and return false (unable to add a new employee)

Else: Based on the type of employee indicated in ‘empType’ add a new employee of the specified type to the end of the array ‘employees and return true.

o empType:   1 – Hourly Employee, 2 – Salaried Employee, 3 – Commission Employee removeEmployee (index : Integer)

Remove the employee stored at position ‘index’ in the ‘employees’ array by overwriting it with the employee stored in the last position of the array. Be sure to decrement the number of employees currently stored.

sortByEmpNumber ()

Using the Bubble Sort algorithm (or other sort algorithm of your choice) sort the array of employees ascending by employee number

sortByLastName ()

Using the Bubble Sort algorithm (or other sort algorithm of your choice) sort the array of employees ascending by employee last name

Use the ‘compareTo’ method to compare 2 String values: i.e.:

if (employees[x].getLastName().compareTo(employees[x+1].getLastName()) > 0)

// employees[x] > employees[x+1] holidayBonuses () : Double

Calculate the total bonus amount due to all employees

As each employee is processed, display the bonus due for that employee annualRaises ()

Give each employee a raise by invoking the annualRaise() method for each employee in the array calculatePayout () : Double

Calculate the total amount to be paid in salary for the current week resetAllWeeks ()

Reset all employee’s values back to zero by calling the resetWeek() method for each employee

File/Class 6: EmployeeDriver

This file is provided for you and should not be changed in any way. This class creates an EmployeeList object and manipulates the EmployeeList using a menu of options.

File/Class 7: Menu

This file is provided for you and should not be changed in any way. This class creates a menu object using a list of menu options. When the runMenu() method is invoked, the menu is displayed, the user is prompted to choose an option, the option is validated allowing the user to correct errors, and the option number is returned to the caller.

Summary of Files

You will need seven (7) files for this. Of these seven (7), you will create five (5) based on the UML diagrams and discussion provided above.

Employee.java

HourlyEmployee.java

SalaryEmployee.java

CommissionEmployee.java

EmployeeList.java

EmployeeDriver.java (provided – NO changes allowed)

Menu.java (provided – NO changes allowed)

SUMMARY OF ASSIGNMENT / HOW TO COMPILE

Create the directory for this assignment as defined below under ‘PROGRAM FILE COLLECTION’ below.

mkdir SPRING2016-CSCI-1620-006-P1

Change directories to the directory using the ‘cd’ command:

a.   cd SPRING2016-CSCI-1620-006-P1

Copy the EmployeeDriver.java and Menu.java files to the directory for this assignment on loki using the WinSCP (or CyberDuck for a Mac) program.

Create the five (5) remaining Java files as described above.

Once these steps are done, you'll want to test your progress by compiling the program, like this:

[user@loki user]$ javac Employee.java

[user@loki user]$ javac HourlyEmployee.java

[user@loki user]$ javac SalaryEmployee.java

[user@loki user]$ javac CommissionEmployee.java

[user@loki user]$ javac EmployeeList.java

[user@loki user]$ javac Menu.java

[user@loki user]$ javac EmployeeDriver.java

If compilation fails or your program doesn't do what it's supposed to do, go back and edit the appropriate files, recompile and re-run your program to test it.

Required Elements:

All outputs to the user must include identifying text and should match the output format described above.

The user should be prompted for all inputs.

Employee {abstract}

# firstName : String

# lastName : String

# fulltime : Boolean

# gender : Character

# employeeNum : Integer

<<constructor>> Employee (first : String, last : String, gen : Character ,

empNum : Integer, full : Boolean )

+ getEmployeeNumber() : Integer

+ setEmployeeNumber(empNum : Integer)

+ getFirstName() : String

+ getLastName() : String

+ toString() : String

+ calculateWeeklyPay() : Double {abstract}

+ annualRaise() {abstract}

+ holidayBonus() : Double {abstract}

+ resetWeek() {abstract}

Explanation / Answer


public class EmployeeDriver
{

    public static void main (String args[])
    {

        EmployeeManager em = new EmployeeManager();

        int selection = 0;
      
        do
        {

            selection = em.mainMenu();
          
            switch (selection)
            {
                case 1 :
                    em.empSubmenu1();
                    break;
                case 2 :
                    em.addEmployee();
                    break;
                case 3 :
                    em.removeEmployee();
                    break;
                case 4 :
                    em.sortEmployee();
                    break;
                case 5 :
                    em.calculateWeeklyPayout();
                    break;
                case 6 :
                    em.calculateBonus();
                    break;
                case 7 :
                    em.annualRaises();
                    break;
                case 8 :
                    em.resetWeek();
                    break;
          
            } // end switch statement

        } while (selection != 9); //end loop
      

    } //end main method

} //end EmployeeDriver class

CommissionEmployee.java


public class CommissionEmployee extends Employee
{

    double sales, rate;
// Descrition       : Accepts all that Employee requires and sets the rate to the defined value as well as sets sales to 0.0

    public CommissionEmployee(String fn, String ln, char m, char g, int empNum, boolean ft, double r)
    {
        super(fn, ln, m, g, empNum, ft);

        sales = 0.0;

        if (r >= 0)
        {
            rate = r;
        }

        else
        {
            rate = 0.0;
        }

    } //end constructor
// Descrition       : Returns a String identical to Employee's toString as well as outputting the rate and sales of the employee

    @Override
    public String toString()
    {

        return String.format(" %sRate: %.2f Sales: %.2f", super.toString(), rate, sales);

    } //end toString method
// Descrition       : Returns the rate percentage of sales

    @Override
    public double calculateWeeklyPay()
    {
        double tempRate = 0.0;

        tempRate = rate * .01;

        return sales * tempRate;

    } //end calculateWeeklyPay method

// Descrition       : Increases rate by .2%

    @Override
    public void annualRaise()
    {

        rate += rate*.02;

    } //end annualRaise method
// Descrition       : Null method

    @Override
    public double holidayBonus()
    {
        return 0.0;
    } //end holidayBonus method

// Descrition       : Resets sales to 0.0

    @Override
    public void resetWeek()
    {
        sales = 0.0;
    } //end resetWeek method

// Descrition       : Increases sales by a secified amount

    public void increaseSales(double amount)
    {

        if (amount >= 0)
        {
            sales += amount;
        }

        else
        {
            System.out.print(" You attempted to increase sales by a negative value. No change has occured.");
        }

    } //end increaseSales method

} //end CommissionEmployee class


Employee.java

import java.util.Scanner;

public abstract class Employee
{

    protected String firstName, lastName;
    protected char middleInitial;
    protected boolean fulltime;
    private char gender;
    private int employeeNum;

// Description      : This sets the passed variables to the field variables.

    public Employee(String fn, String ln, char m, char g, int empNum, boolean ft)
    {
        Scanner in = new Scanner (System.in);

        firstName = fn;
        lastName = ln;
        middleInitial = m;
        fulltime = ft;

        if (g == 'M' || g == 'F')
        {  
            gender = g;
        }
        else if (g == 'm')
        {
            gender = 'M';
        }
        else
        {  
            gender = 'F';
        }

        setEmployeeNumber(empNum);
    } //end constructor

// Description      : Returns the employee number.

    public int getEmployeeNumber()
    {
        return employeeNum;
    } //end getEmployeeNumber method

// Description      : Returns last name of employee

    public String Name()
    {
        return lastName;
    } //end Name method
the employee number to the one passed to the method.

    public void setEmployeeNumber(int empNum)
    {
        Scanner in = new Scanner(System.in);

        if (empNum >= 10000 && empNum <= 99999)
        {
            employeeNum = empNum;
        }
        else
        {
            do
            {
            System.out.print("Invalid employee number. Enter a new one between 10000 and 99999.");
            empNum = in.nextInt();

            }while (empNum < 10000 || empNum > 99999);
          
        employeeNum = empNum;

        }

     } //end setEmployeeNumber method

// Description      : Compares two employees to see if they have the same employee number.

    @Override
    public boolean equals(Object e2)
    {
        if (this.employeeNum == ((Employee)e2).employeeNum)
        {
            return true;
        }
        else
        {
            return false;
        }
    } //end equals method

// Descrition       : Returns a String of the employee number, name, gender, and status.

    @Override
    public String toString()
    {
        String requested = "";
        requested = employeeNum + " " + lastName + ", " + firstName + " " + middleInitial + ". " + "Gender: " + gender + " Status: ";

        if (fulltime)
        {
            requested += "Full Time ";
        }
        else
        {
            requested += "Part Time ";
        }

        return requested;
    } //end toString method

// Descrition       : Abstract method which will later calculate how much to pay employee in a week.

    public abstract double calculateWeeklyPay();

// Descrition       : Abstract method which will later calculate a raise for the employee.

    public abstract void annualRaise();

// Descrition       : Abstract method which will later give Employee their holidy bonus payout.

    public abstract double holidayBonus();

// Descrition       : Abstract method which will later reset the weekly values for Employee.

    public abstract void resetWeek();

} //end Employee class


HourlyEmployee.java

import java.util.Scanner;

public class HourlyEmployee extends Employee
{

    double wage, hoursWorked;

// Descrition       : Accepts all that Employee requires as well as a double for wage. Sets hoursWorked to 0.0

    public HourlyEmployee(String fn, String ln, char m, char g, int empNum, boolean ft, double w)
    {            
        super(fn, ln, m, g, empNum, ft);
      
        Scanner in = new Scanner (System.in);

        if (w >= 0)
        {
            wage = w;
        }
        else
        {
            do
            {
                System.out.print(" Invalid wage. Enter another. ");
                w = in.nextDouble();
            }while (w < 0);

            wage = w;
        }

        hoursWorked = 0.0;

    } //end constructor

// Descrition       : Overrides Employee's toString so it does everything Employee's toString does as well as output wage and hours worked.

    @Override
    public String toString()
    {
        return String.format(" %sWage: %.2f Hours Worked: %.2f", super.toString(), wage, hoursWorked);

    } //end toString method

// Descrition       : Returns amount earned in the week using wage and hoursWorked. Over 40 = double wage.

    @Override
    public double calculateWeeklyPay()
    {
        double pay = 0.0;

        if (hoursWorked <= 40)
        {
            pay = wage * hoursWorked;
        }
        else
        {
            pay = wage * 40;
            hoursWorked -= 40;
            pay += (wage * 2) * hoursWorked;
        }

        return pay;

    } //end calculateWeeklyPay method

// Descrition       : Increases wage by 5%

    @Override
    public void annualRaise()
    {
        wage += wage * .05;

    } //end annualRaise method

// Descrition       : Gives a bonus equivilant to 40 hours worked.

    @Override
    public double holidayBonus()
    {
        return wage * 40;

    } //end holidayBonus method

// Descrition       : Resets hours worked to 0.

    @Override
    public void resetWeek()
    {
        hoursWorked = 0.0;

    } //end resetWeek method

// Descrition       : Increased hours worked. If a negative value is recieved, no change is made and an error is reported.

    public void increaseHoursWorked(double inc)
    {
        if (inc >= 0)
        {
            hoursWorked += inc;
        }
        else
        {
            System.out.print(" Negative increase requested. Request could not be completed. ");
        }

    } //end increaseHoursWorked method

} //end HourlyEmployee class


SalaryEmployee.java
public class SalaryEmployee extends Employee
{

    double salary = 0.0;

// Descrition       : Sets the values of the name, gender, employee number, full time status, and salary for the SalaryEmployee

    public SalaryEmployee(String fn, String ln, char m, char g, int empNum, boolean ft, double s)
    {
        super(fn, ln, m, g, empNum, ft);
      
        if (salary >= 0)
        {
            salary = s;
        }

        else
        {
            salary = 0;
        }

    } //end constructor

// Method Name      : toString
// Parameters       : None
// Return value(s) : String
// Partners         : None
// Descrition       : Overrides the toString method to dislay the Employee class's toString as well as output the salary of the employee

    @Override
    public String toString()
    {

        return String.format(" %sSalary: %.2f", super.toString(), salary);

    } //end toString method

// Descrition       : Returns amount earned in the week by dividing salary by 52

    @Override
    public double calculateWeeklyPay()
    {

        return salary/52;

    } //end calculateWeeklyPay method

// Method Name      : annualRaise
// Parameters       : None
// Return value(s) : None
// Partners         : None
// Descrition       : Increases salary by %6

    @Override
    public void annualRaise()
    {

        salary += salary*.06;

    } //end annualRaise method

// Descrition       : Returns 3% of salary as a bonus

    @Override
    public double holidayBonus()
    {

        return salary * .03;

    } //end holidayBonus method
@Override
    public void resetWeek()
    {
    } //end resetWeek method

} //end SalaryEmployee class


output
No Employees.                                                                                                                                               
                                                                                                                                                            
1. Employee Submenu                                                                                                                                         
2. Add Employee                                                                                                                                             
3. Remove Employee                                                                                                                                          
4. Sort Employees                                                                                                                                           
5. Calculate Weekly Payout                                                                                                                                  
6. Calculate Bonus                                                                                                                                          
7. Annual Raises                                                                                                                                            
8. Reset Week                                                                                                                                               
9. Quit                                                                                                                                                     
                                                                                                                                                            
Enter Choice: 1                                                                                                                                             
1. Hourly Employees                                                                                                                                         
2. Salary Employees                                                                                                                                         
3. Commission Employees                                                                                                                                     
4. Back                                                                                                                                                     
                                                                                                                                                            
Enter Choice : 1                                                                                                                                            
1. Add Hours                                                                                                                                                
2. Back                                                                                                                                                     
                                                                                                                                                            
Enter Choice: 1                                                                                                                                             
                                                                                                                                                            
Enter employee number: 1                                                                                                                                    
How many hours to be added? 2                                                                                                                               
                                                                                                                                                            
Employee number did not match an hourly employee                                                                                                            
1. Hourly Employees                                                                                                                                         
2. Salary Employees                                                                                                                                         
3. Commission Employees                                                                                                                                     
4. Back                                                                                                                                                     
                                                                                                                                                            
Enter Choice : 4                                                                                                                                            
                                                                                                                                                            
Main Menu                                                                                                                                                   
No Employees.                                                                                                                                               
                                                                                                                                                            
1. Employee Submenu