Question: L. Write a class Employee that has the following instance variables Employee id (integer) Employee Name (String) Designation (String) Salary (double) The valid designations from
L. Write a class Employee that has the following instance variables Employee id (integer) Employee Name (String) Designation (String) Salary (double) The valid designations from bottom to top in the hierarchy are "Systems Engineer" IT Analyst". "Assistant Consultant" "Associate Consultant", "Consultant", "Senior Consultant", "Principal Consultant". Vice President" and "CEO" Add a constructor that initializes all the above instance variables. Then add a method computeBonus() that gives 5% bonus (i.e., 5% of the salary) to designation up to "Assistant Consultant", 10% bonus to designation from"Associate Consultant" to "Senior Consultant" and 20% bonus to designations "Principal Consultant" and above. Add a method computeBonus0 that updates the salary after computing the bonus. Create a class EmployeeTester that will create an employee object for each valid designation and compute the updated salary after adding the bonus. Then print the data for all employees in the following format Employee id I Employee Name I Designation | Bonus | Salany 2. Write a class Fan that has the following instance variables Speed (an integer indicating the speed in r.p.m or Revolutions per minute, with
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
