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

  Define private instance variable to hold boolean value

Write a Java Enumeration "LetterGrade" that represents letter grades A through F including plus and minus grades. Define a private instance variable to hold a boolean value.

  Javas drawing capabilities

This week, we will be learning to use some of Java's drawing capabilities. The Graphics class provides methods for drawing many different shapes, using different colors, and for drawing strings using different fonts.

  Implementing a relatively simple text-compression scheme

You will be implementing a relatively simple text-compression scheme - It should run from the command line.

  Development of a graphical user interface

To understand actual communication with an SMTP server can be achieved using TCP Sockets and understand the development of a graphical user interface (GUI) and use of event handling.

  Program to track hourly employee arrival and departure time

THE JAVA SOURCE CODEA company hires you to write a program to track hourly employee arrival and departure times from work. In essence, you are tasked to make an online time clock. The time clock shall keep a history of an employee’s hours for a two-w..

  Write a java program called salesinfominer

Write a Java program called SalesInfoMiner that reads in a file of products, stored in text format. The program must then read in information about past sales transactions and output all the products to a new file, sorted by product description,..

  Test plan for both unit testing and integration testing

Do a test plan for both unit testing and integration testing, justification why you need this test creating the test case for each individual test must use java language in netbeans IDE to perform each test, screen capture one example to run the ..

  Information systems to strengthen customer

Which of the following illustrates the use of information systems to strengthen customer and supplier intimacy? BPM is considered concluded when the new processes are both implemented and accepted.

  Write a dim statement that declares a myfriend variable

Write a Dim statement that declares a MyFriend variable named school. Write an assignment statement that  assigns the value in the txtFirst control to the strFirst member

  Demonstrate the use of conditional and looping structures

The application should have two classes; at least one class in addition to the application's controlling class. The source code must demonstrate the use of conditional and looping structures.

  Afterwards a way for the user to input

And so on and so forth then afterwards a way for the user to input that they finished a particular task on the list. After the user has input that they have finished a particular task the program should be print "Good Job!" or "Keep it up!"

  What secret does soraya tell amir

What secret does soraya tell amir and how does amir react to this information

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