Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions