Create the benefit class

Assignment Help JAVA Programming
Reference no: EM13842144

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.

Reference no: EM13842144

Questions Cloud

What are some potential problems of poor database design : Discuss some of the ways in which data mining can help a company generate more business. What are some potential problems of poor database design
What criteria were used in making the decision : What criteria were used in making the decision? Would you use different criteria now? How would you evaluate the decision?
Compares the theories of jung adler and horney : Prepare a paper of 1,250-1,500 words that compares and contrasts the theories of Jung, Adler, Horney, and Erikson with the theory of Freud
What ports are found on the computer : What ports are found on the computer. What is the size of the monitor. Is it a touchscreen monitor
Create the benefit class : create the Benefit class
By including all stakeholders in the process redesign : By including all stakeholders in the process redesign; proper roles and responsibilities are defined.  While very often debated, the functional area that should have responsibility for a component of the process usually does despite how unpleasant th..
Write method that checks whether string is a valid password : Write a program that prompts the user to enter a password and displays Valid Password if the rules are followed or Invalid Password otherwise to verify a password according to as set of rules stated in the problem statement
Foundational element for sound decision making in business : Is Focusing on the process not individual functional area is a foundational element for sound decision making in business to increase the probability for positive business outcomes. discuss that ?
Measuring non financial performance : Research Six Sigma, Balanced Scorecard, and Triple Bottom Line. (A Google search with ethics AND the chosen model works well.) Which do you think would be most helpful in measuring nonfinancial performance? Why?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd