Design two sub- classes of Employee...SalariedEmployee and HourlyEmployee. A salaried employee has an annual salary attribute. An...

90.2K

Verified Solution

Question

Programming

Design two sub- classes of Employee...SalariedEmployee andHourlyEmployee. A salaried employee has an annual salary attribute.An hourly employee has an hourly pay rate attribute, an hoursworked attribute, and an earnings attribute. An hourly employeethat works more than 40 hours gets paid at 1.5 times their hourlypay rate. You will decide how to implement constructors, getters,setters, and any other methods that might be necessary.

1. (20 points) Draw a UML diagram for the classes.

2. (80 points) Implement the classes, and write a test programthat creates a salaried employee and two hourly employees. One ofthe hourly employees should have hours worked set to less than 40and one should have hours worked set to more than 40.

The test program should display all attributes for the threeemployees. To keep things simple, the employee classes don’t needto do any editing.

I really need help with the first part of this questionregarding the UML.

Answer & Explanation Solved by verified expert
4.1 Ratings (801 Votes)
NotesEmployee Class details are not provided in the questiondescription Hence the details are assumed for the sake ofconvenient understanding and used in the UML Diagram Please feelfree to change as per the intended needsPlease    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students