Question
I need a UML use case diagram for this code: /********************************************************** *Filename: payroll.java *Author: Quinten Spangler *Section: IST 242 *Assignment: Wk 02 - Lab #2
I need a UML use case diagram for this code:
/**********************************************************
*Filename: payroll.java
*Author: Quinten Spangler
*Section: IST 242
*Assignment: Wk 02 - Lab #2
*Description: Calculates the pay of 3 employees
*Date Created: 1/25/2018
*********************************************************/
import java.util.Scanner;
public class payroll {
static String empFName[] ;
static int empHoursWorked[] ;
static double empHoursPay[] ;
static double regularHours[] ;
static String empLName[] ;
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter number of employees");
int empNo = sc.nextInt();
empFName = new String[empNo];
empHoursPay = new double[empNo];
empHoursWorked = new int[empNo];
regularHours = new double[empNo];
empLName = new String[empNo];
getEmployeeFirstNames(empFName, sc);
getEmployeeLastNames(empLName, sc);
getEmployeeWorkingHours(empHoursWorked, sc);
getEmployeeHoursPay(empHoursPay, sc);
getEmployeeRegularHours(regularHours, sc);
printEmployeeData(empFName, empLName, empHoursWorked, empHoursPay, regularHours);
}
public static void printEmployeeData(String fname[], String lname[], int workHours[], double pay[], double regularHours[]) {
double grosspay[] = new double[fname.length];
double overtimeHours;
for(int i=0;i overtimeHours = workHours[i] - regularHours[i]; grosspay[i] = (int) ((regularHours[i]* pay[i]) + (overtimeHours * pay[i]*1.5)); } for(int i=0;i double averagepay = 521.67; System.out.println("Employee First Name: "+fname[i]); System.out.println("Employee Last Name: "+lname[i]); System.out.println("Hours: "+workHours[i]); System.out.println("PayRate: "+pay[i]); System.out.println("Employee Gross Pay: "+grosspay[i]); System.out.println("Department average: " + averagepay); } } public static void getEmployeeRegularHours(double hours[], Scanner sc) { for(int i=0;i System.out.println("Enter employee regular hours (Max 40): "); regularHours[i] = sc.nextDouble(); } } public static void getEmployeeHoursPay(double arr[], Scanner sc) { for(int i=0;i System.out.println("Enter employee working pay: "); arr[i] = sc.nextDouble(); while(arr[i] > 40) { System.out.println("No employee can have regular hours more than 40. Enter value agaian!!"); arr[i] = sc.nextInt(); } } } public static void getEmployeeWorkingHours(int arr[], Scanner sc) { for(int i=0;i System.out.println("Enter employee working hours: "); arr[i] = sc.nextInt(); } } public static void getEmployeeFirstNames(String arr[], Scanner sc) { for(int i=0;i System.out.println("Enter employee First Name: "); arr[i] = sc.next(); } } public static void getEmployeeLastNames(String arr[], Scanner sc) { for(int i=0;i System.out.println("Enter employee Last Name: "); arr[i] = sc.next(); } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started