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

PLEASE READ THE SAMPLE OUTPUT below and all directions. The code must give this

ID: 3825083 • Letter: P

Question

PLEASE READ THE SAMPLE OUTPUT below and all directions. The code must give this EXACT output. This includes, Employee.java working with the test code EmployeeTest.java (provided below) and producing the same kind of sample output as below. As well as USING ALL THE METHODS LISTED BELOW. I have been having trouble with this project. I have asked this same question 4 separate times, please pay attention to the instructions. I appreciate your help!!!

Objective:

The main objective of this project is to be able to design, create and utilize classes and objects. You are to write a class based on the following UML diagram. Your class will be called “Employee” and reside in a source file named “Employee.java”.

YOU MUST USE ALL OF THE FOLLOWING IN YOUR CODE!!!!

Assignment Task(s):

The class Employee will be used to define or instantiate objects that contain the fields and the methods defined in the UML diagram above.

The “set” methods will allow data to be passed into an object.

The “get” methods will allow data to be retrieved from an object.

The “inputAll” method will allow data to be entered (from the keyboard) by a user directly into the instant variables of an object. You may use the Scanner class to handle keyboard input. This method will return a Boolean value based on whether the user enters a Last Name for the Employee. If no last name is entered, none of the other employee information will be prompted for.

***IMPORTANT!!! After the employee information has been entered for employee 2-5, the “equals” method will be used to determine if the first and last name of the current employee match the first and last name of the first employee. If both first and last names match, the “equals” method returns true. “false” otherwise.*******

You MUST use the main method in the “EmployeeTest” class below to test your class. If you instantiate the Employee class into an object (e.g., person1), the main method is ignored.

public class EmployeeTest
{
public static final int MAX_EMPLOYEES = 5;

public static void main(String[] args)
{
Employee employee[] = new Employee[MAX_EMPLOYEES];
  
employee[0] = new Employee();
employee[0].setLastName( "Murphy" );
employee[0].setFirstName( "Audie" );
employee[0].setId( "57831" );
employee[0].setPhone( "619-555-1212" );
employee[0].setYearlySalary( 40000 );
employee[0].calcBonus( 5 );
employee[0].calcMonthlyPay();
System.out.println( employee[0] );

for ( int lp=1; lp {
employee[lp] = new Employee();
System.out.println( "Employee No. " + ( lp+1 ));
if ( employee[lp].inputAll())
{
employee[lp].calcMonthlyPay();
System.out.println( employee[lp] );
}
else
{
System.out.println( "NO Information for Employee " + ( lp+1 ));
lp = MAX_EMPLOYEES;
}
}
}   
}

Sample Output (IMPORTANT):

Employee Information
Last Name : Murphy
First Name : Audie
Employee ID : 57831
Employee Phone : 619-555-1212
Yearly Salary : $40000.00
Yearly Bonus : $2000.00
Monthly Salary : $3500.00

Employee No. 2
Enter Last Name : York
Enter First Name : Alvin
Enter Employee Id : 94834
Enter Phone Number : 619-555-9874
Enter Yearly Salary : $36000
Enter Yearly Bonus (%) : 2
Employee Match : false

Employee Information
Last Name : York
First Name : Alvin
Employee ID : 94834
Employee Phone : 619-555-9874
Yearly Salary : $36000.00
Yearly Bonus : $720.00
Monthly Salary : $3060.00

Employee No. 3
Enter Last Name :
NO Information for Employee 3

Assignments Evaluations:

Definition of private instance variables
Definition of public get & set methods
Implementation of public inputAll() method
Proper implementation of public toString() method
Proper implementation of public equals() method <------Please implement properly as detailed above in directions.
Proper source code and documentation

The EmployeeTest.java must produce accurate results and work with Employee.java without errors as described in the directions.

Screenshot of output:

Employee class lastName String firstName String id String phone String yearly salary: double bonus double monthly Salary: double set LastName String getLastName String set FirstName String getFirstName String 3etid String getId ring set Phone String get Phone String set Yearly Salary double getYearly Salary double calcBonus percent double calcMonthly Pay inputAll boolean toString String t als boolean

Explanation / Answer

import java.util.*;
class Employee
{
private String id;
private String lastName;
private String firstName;
private String phone;
private double yearlySalary;
private double yearlyBonus;
public Employee()
{
  
}
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
public String getFirstName()
{
return firstName;
}
public void setLastName(String lastName)
{
this.lastName = lastName;
}
public String getLastName()
{
return lastName;
}
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setYearlySalary(double yearlySalary)
{
this.yearlySalary = yearlySalary;
}
public double getYearlySalary()
{
return yearlySalary;
}
public void setYearlyBonus(double yearlyBonus)
{
this.yearlyBonus = yearlyBonus;
}
public double getYearlyBonus()
{
return yearlyBonus;
}
public double calcBonus()
{
return yearlySalary*yearlyBonus/100;
}
public double calcMonthlyPay()
{
return yearlySalary/12;
}
public String toString()
{
return " Last Name : "+lastName+" First Name : "+firstName+" Employee ID : "+id+" Employee Phone : "+phone+" Yearly Salary : $"+yearlySalary+" Yearly Bonus : $"+yearlyBonus+" Monthly Salary : $"+calcMonthlyPay();
}
public boolean equals(Employee E)
{
if(this.firstName == E.firstName && this.lastName == E.lastName)
return true;
else
return false;
}
public boolean inputAll()
{
Scanner scan = new Scanner(System.in);
  
System.out.println(" Enter the Last Name of the Employee");
lastName = scan.next();
if(lastName == " ")
return false;

System.out.println(" Enter the First Name of the Employee");
firstName = scan.next();
System.out.println(" Enter the ID of the Employee");
id = scan.next();
System.out.println(" Enter the Phone of the Employee");
phone = scan.next();
System.out.println(" Enter the Annual Salary of the Employee");
yearlySalary = scan.nextDouble();
System.out.println(" Enter the Annual Bonus of the Employee");
yearlyBonus = scan.nextDouble();
return true;


}

  
}

class EmployeeTest
{
public static final int MAX_EMPLOYEES = 5;
public static void main(String[] args)
{
Employee employee[] = new Employee[MAX_EMPLOYEES];
System.out.println(" Employee Information");
employee[0] = new Employee();
employee[0].setLastName( "Murphy" );
employee[0].setFirstName( "Audie" );
employee[0].setId( "57831" );
employee[0].setPhone( "619-555-1212" );
employee[0].setYearlySalary( 40000 );
employee[0].setYearlyBonus(2);
employee[0].calcBonus();
employee[0].calcMonthlyPay();
System.out.println( employee[0] );

employee[1] = new Employee();
if(employee[1].inputAll() == true)
System.out.println( employee[1] );


System.out.println(" Matches : "+employee[0].equals(employee[1]));

}   
}

Output:

Employee Information

Last Name : Murphy
First Name : Audie
Employee ID : 57831
Employee Phone : 619-555-1212
Yearly Salary : $40000.0
Yearly Bonus : $2.0
Monthly Salary : $3333.3333333333335

Enter the Last Name of the Employee York

Enter the First Name of the Employee Alvin

Enter the ID of the Employee 94834

Enter the Phone of the Employee 619-555-9874

Enter the Annual Salary of the Employee 36000

Enter the Annual Bonus of the Employee 2

Last Name : York
First Name : Alvin
Employee ID : 94834
Employee Phone : 619-555-9874
Yearly Salary : $36000.0
Yearly Bonus : $2.0
Monthly Salary : $3000.0

Matches : false

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote