Question
The List of Employee Types Type Weekly Payment Method Cobra Commander 1 Dollar (He makes his money by improving the overall value of the company)
Type | Weekly Payment Method |
Cobra Commander | 1 Dollar (He makes his money by improving the overall value of the company) |
High Command | Base Salary/52 |
Crimson Guard | Base Salary/52 + (# Hours > 40) * 25 |
Cobra Trooper | (# Hours 40) * 25=> |
Every person has a name, a base salary and number of hours worked in a week.
Create an Employee Base class. It should have the following:
1.A constructor that accepts weekly hours, name and base salary 2.An accessor method for name, a base salary and number of hours worked in a week. 3.An abstract method for the weekly pay that returns a double.
Create a child class for the four employee types. They should each have the following: 1.A method that overrides the weekly pay method with the correct implementation for the amount. 2.A method that overrides the toString method the prints the employee name and the weekly pay.
3. Create a Class with a main method that prints the employee name and the weekly pay based on the following data. Use an arraylist of Employees to hold all the different employees. Also calculate the total payroll for the week. Use a loop!
Employee Type | Name | Base Salary | Hours for the week |
Cobra Commander | Cobra Commander | 0 | 120 |
High Command | Destro | 1,200,000 | 90 |
High Command | Baroness | 900,000 | 85 |
Crimson Guard | Greg | 125,000 | 60 |
Crimson Guard | Marcia | 125,000 | 67 |
Crimson Guard | Peter | 120,000 | 70 |
Crimson Guard | Jan | 80,000 | 40 |
Cobra Trooper | Larry | 0 | 45 |
Cobra Trooper | Curly | 0 | 35 |
Cobra Trooper | Moe | 0 | 50 |
Cobra Trooper | Marvin the Martian | 0 | 33 |
Cobra Trooper | Hawk | 0 | 18 |
Cobra Trooper | Torpedo | 0 | 56 |
Cobra Trooper | Scarlett | 0 | 43 |
Cobra Trooper | Scoop | 0 | 25 |
As you may have figured out you work for Cobra. They are really big on discipline and documentation. Make sure you use javadocs and proper naming conventions.
- Javadocs and Naming Conventions (2 points)
- Parent Class 1 point
- Each child class 1 point (4 total)
- Class with Main method
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started