Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE READ THE SAMPLE OUTPUT below and all directions. The code must give this exact output in the same format and meet all criteria. This

PLEASE READ THE SAMPLE OUTPUT below and all directions. The code must give this exact output in the same format and meet all criteria. This includes, Employee.java working with the test code EmployeeTest.java (provided below) and producing the same kind of sample output as below. I have been having trouble with this project. 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.

Employee class

lastName: String firstName: String id: String phone: String yearlySalary: double bonus: double monthlySalary: double

+ setLastName( String ) + getLastName(): String + setFirstName( String ) + getFirstName(): String + setId( String ) + getId(): String + setPhone( String ) + getPhone(): String + setYearlySalary( double ) + getYearlySalary(): double + calcBonus( percent: double ) + calcMonthlyPay() + inputAll(): boolean + toString(): String + equals(): boolean

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.

The toString method will return a string containing the formatted output. It should look like: 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

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

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 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:

image text in transcribed

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 Alvin Enter First Name 94834 Enter Employee Id 619-555-9874 Enter Phone Number 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 Yearly Salary $36000.00 Yearly Bonus $720.00 Monthly salary $3060.00 Employee No. 3 Enter Last Name NO Information for Employee 3

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 Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago