Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA CODE .. Urgentttttt :( EMPLOYEE.java code; import java.util.Calendar; import java.util.GregorianCalendar; public class Employee { private String id; private String name; private double hourRate; private

JAVA CODE .. Urgentttttt :(

EMPLOYEE.java code;

import java.util.Calendar; import java.util.GregorianCalendar;

public class Employee {

private String id; private String name; private double hourRate; private GregorianCalendar sow; private GregorianCalendar dob; public Employee() { //Empty constructor } public Employee(String id, String name, double hourRate, GregorianCalendar sow, GregorianCalendar dob) { this.id = id; this.name = name; this.hourRate = hourRate; this.sow = sow; this.dob = dob; } public Employee(String id, String name, double hourRate) { this.id = id; this.name = name; this.hourRate = hourRate; } public Employee(String id, String name, double hourRate, GregorianCalendar sow) { this.id = id; this.name = name; this.hourRate = hourRate; this.sow = sow; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getHourRate() { return hourRate; } public void setHourRate(double hourRate) { this.hourRate = hourRate; } public GregorianCalendar getSow() { return sow; } public void setSow(GregorianCalendar sow) { this.sow = sow; } public GregorianCalendar getDob() { return dob; } public void setDob(GregorianCalendar dob) { this.dob = dob; } public String toString() { String sowdate = sow.get(Calendar.YEAR) + "-" + (sow.get(Calendar.MONTH) + 1) + "-" + sow.get(Calendar.DAY_OF_MONTH); String dobdate = dob.get(Calendar.YEAR) + "-" + (dob.get(Calendar.MONTH) + 1) + "-" + dob.get(Calendar.DAY_OF_MONTH); return id+" / "+name+" / "+ hourRate+" / "+ sowdate+" / "+ dobdate ;}}

EMSystem.java code;

import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Random;

public class EMSystem {

Employee[] myEmployees = new Employee[100]; Logfile[][] logs = new Logfile[100][25]; Employee eom; //Method Definitions public Employee findEmployeeOfMonth() { int[] total = new int[100]; for (int i = 0; i max) max = i; } eom = myEmployees[max]; return eom; } public static int randBetween(int start, int end) { return start + (int)Math.round(Math.random() * (end - start)); } public EMSystem() { String[] namelist = new String[5]; namelist[0] = "cagatay"; namelist[1] = "batuhan"; namelist[2] = "mert"; namelist[3] = "salih"; namelist[4] = "ali"; String[] surnamelist = new String[5]; surnamelist[0] = "yilmaz"; surnamelist[1] = "ozturk"; surnamelist[2] = "arslan"; surnamelist[3] = "demir"; surnamelist[4] = "yildirim"; for (int i = 0; i

LOGFLE.java code;

import java.util.Calendar; import java.util.GregorianCalendar;

public class Logfile { GregorianCalendar Entry, Exit;

public Logfile(GregorianCalendar Entry, GregorianCalendar Exit) { this.Entry = Entry; this.Exit = Exit; }

public GregorianCalendar getEntry() { return Entry; }

public void setEntry(GregorianCalendar entry) { Entry = entry; }

public GregorianCalendar getExit() { return Exit; }

public void setExit(GregorianCalendar exit) { Exit = exit; } public String toString() { return "start:"+Entry.get(Calendar.HOUR) + "/end:"+Exit.get(Calendar.HOUR); } }

RUNEMS.java code;

public class RunEMS {

public static void main(String[] args) { EMSystem system = new EMSystem(); System.out.println(system.findEmployeeOfMonth().toString()); } }

image text in transcribed

Implement Salary Calculation for each of the Salary , Rate Employee , Comission Employee and Comission Base Employee classes

Create 200 Random Employee with random working hours for each of them and assign them into an Employee Array.

Calculate and Print Monthly salaries of each employee by traversing Employee arrray.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions