The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 4 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Design and implement a class Employee in a java file called Employee.java. The class should contain instance variables for employee’s name, age, years Of Service.
Define the Employee constructor to accept and initialize instance data. The class should also keep track of the number of employee objects created using a static variable. This variable gets incremented every time in the constructor.
Include get and set methods for the three instance variables.
• Include a instance method called isEligibleForRetirement() that returns a boolean.
• true if the employee is eligible for retirement, false if not.
• For an employee to be eligible for retirement, the sum of age and years of service
needs to be greater than 60.Â
• Create a client class called EmployeeApp (in a file called EmployeeApp.java) which has a main method.
• Using Scanner class, it will ask the user for data for 2 employees.
• i.e. name, age, and years of service for emp 1 and then emp 2.
• Take this user input and invoke the constructor of Employee class, passing the
user provided input as arguments. You now have 2 initialized Employee instances.
• Now, your main method should print the number of Employee objects created,
display data for each, and specify whether each employee is eligible for
retirement or not.
Â
Assignment 4•Design and implement a classEmployeein a java file called Employee.java. The classshould contain instance variables foremployee’s name,age,yearsOfService.•Define theEmployee constructorto accept and initialize instance data. The class shouldalso keep track of the number of employee objects created using astatic variable. Thisvariable gets incremented every time in the constructor.•Includegetandsetmethods for the three instance variables.•Include a instance method calledisEligibleForRetirement()that returns aboolean.•trueif the employee is eligible for retirement,falseif not.•For an employee to be eligible for retirement, the sum of age and years of serviceneeds to be greater than 60.
Attachments:
-----------