Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

STEP 1: Modify the Employee Class

Using the UML Diagrams from Step 1, create the Benefit class. To get an idea of how to format displayBenefits, take a look at the output in Step 3.

Add a Benefit attribute to the Employee class.

Initialize the new Benefit attribute in both Employee constructors. Again, take note of the multi-arg constructors parameter list!

Create the iEmployee interface (abstract class in C++).

Modify the Employee class to implement the new interface so that Employee will have to implement the calculatePay method.Modify the Employee class to call displayBenefit when displaying Employee information.

STEP 2: Modify the Main Method

Notice that the Employee class now has a public benefit object inside it. This means that you can access the set methods of the Benefit object with the following code:.benefit.

As an example, to set the lifeInsurance attribute inside an Employee object called emp, we could execute the following code:emp.benefit.setLifeInsurance(lifeInsurance);

The steps required to modify the Main class are below. New steps are in bold.Create an Employee object using the default constructor.

Prompt for and then set the first name, last name, and gender. Consider using your getInput method from Week 1 to obtain data from the user for this step as well as Step 3.

Prompt for and then set the dependents and annual salary using the overloaded setters that accept Strings.

Prompt for and set healthInsurance, lifeInsurance, and vacation.

Using your code from Week 1, display a divider that contains the string "Employee Information".

Display the Employee Information.

Display the number of employees created using getNumEmployees(). Remember to access getNumEmployees using the class name, not the Employee object.

Create a Benefit object called benefit1 using the multi-arg construction. Use any information you want for health insurance, life insurance, and vacation.

Create another Employee object and use the constructor to fill it with the following:

"Mary", "Noia", 'F', 5, 24000.0, benefit1

Using your code from Week 1, display a divider that contains the string "Employee Information".

Display the employee information.

Display the number of employees created using getNumEmployees(). Remember to access getNumEmployees using the class name, not the Employee object.

Java, Programming

  • Category:- Java
  • Reference No.:- M91411952
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Java

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As