Question: Problem Statement: Develop a program that calculates & displays employee's gross pay. First, write the employee Class definition Employee.java for the UML diagram below Employee
Problem Statement:
Develop a program that calculates & displays employee's gross pay. First, write the employee Class definition Employee.java for the UML diagram below
Employee class
Then, write EmployeeGrossPay.java, a test driver for the Employee class, based on the pseudocode below. You can assume there is at least one employee. User should be prompted to enter name. However, the
employee ID and can be randomly generated digit number. Program should validate numeric inputs are not negative, name is made up of alphabets only, and reject any shift entry other than "Day" & "Night" using
loops, if statements, string methods, char methods, and etc. The program should continue to take input for every employee in a company, and display their information until the user presses return instead of providing
a valid user name. Be sure to format output as shown below. Please note that both files must be in the same directory and you can compile the main class to compile both classes.
Your program should do the following :
start
instantiate an Employee object
get the employee name
loop until the user enters the sentinel value would be good
set workers name
generate the employee ID
set the employee ID
get the employee shift daynight
set the employee shift input "day" true input "night" false
get employee's hourly
set employee's hourly
get the hours the employee worked
display employee pay stub
Check if user wants to continue
end
Examples for day shift & over time are shown below: Note: User input is in bold after each prompt
Employee Name: Ann
Employee Shift daynight: day
Hourly Pay: $
Hours Worked:
Employee Name: Ann
Employee ID:
Pay Period: Friday
Regular Pay: $
Overtime Pay: $
Gross Pay: $
Examples for night shift & regular hours are shown below: Note: User input is in bold after each prompt
Employee Name: Bob
Employee Shift daynight: night
Hourly Pay: $
Hours Worked:
Employee Name: Bob
Employee ID:
Pay Period: Saturday
Regular Pay: $
Overtime Pay: $
Gross Pay: $
Examples for day shift & less than regular hours are shown below: Note: User input is in bold after each prompt
Employee Name: Cara
Employee Shift daynight: day
Hourly Pay: $
Hours Worked:
Employee Name: Cara
Employee ID:
Pay Period: Friday
Regular Pay: $
Overtime Pay: $
Gross Pay: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
