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

  Prepare a simple windows calculator in java it must have a

create a simple windows calculator in java. it should have a labeled text field for the user to provide input as well

  Define a simple interface named motorized with one method

question 1 define a simple interface named motorized with one method maxspeed which returns the maximum attainable

  Communication with an smtp server

Develop a graphical user interface based java program that can communicate with a real SMTP email server for sending emails

  The application with all the specifications should be

the application with all the specifications should be developed based on a graphical user interface.1. implement proper

  Create an array of date objects

Create an array of Date objects of size 4. Initialize the array by using a loop. In the loop, use the Scanner.nextLine() method to input a date as a string, convert it to a date by using the toDate() method, and assign the result to an element in ..

  Write a program that reads in a text file and then computes

Write a program that reads in a text file and then computes and prints a table of letter frequencies. For example, if the file is the text of "A Tale of Two Cities", found in the file at data/tales.txt , the program will print

  Modify the numbers guessing game program

Modify the numbers guessing game program. Suppose that the variable num and guess are as declared and the diff is an int variable.

  Define application using java in the eclipse environment

Within this project create a package called task01. Within this package you will be required to author (write, develop) some classes. These classes are described below

  Write a java application that allows the user to read

Write a java application that allows the user to read, validate, store, display, sort and search the internet account number (integer number), usage (integer number) and cost (double number) for N customers. N should be declared as a constant and it ..

  Implement class that can be player in a game of tic tac toe

Specify, design, and implement a class that can be one player in a game of tic-toc-toe. The constructor should be specify whether the object is to be the first player (X's) or the second player (O's).

  Prepare executable program and a dictionary program

Prepare executable program and a dictionary Program.

  Explain the graphical coordinate system in java where is

question 1 describe the graphical coordinate system in java. where is the origin? what units apply to the xy

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