Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please, quickly, I don't have time Given the following classes a. Company b. Employee 1- Create a constructor of the class company that takes a
Please, quickly, I don't have time
Given the following classes
a. Company
b. Employee
1- Create a constructor of the class company that takes a name as a string and a list of employees
2- Create a constructor of the class employee that takes a name as string and ID as integer
3- Create a subclass of the employee class call it SalaryEmployee that uses the super method to create a SalaryEmployee and an extra field of type float for the amount of the salary
4- Create a subclass of the employee class call it HourlyEmployee that uses the super method to create an HourlyEmployee and an extra two fields 1- number_of_hours 2- hourly_rate
5- Create a field named bonus in the salary employee and give it any initial value
6- Create a calculateSalary in the SalaryEmployee that adds the base salary with the bonus and display it on the screen
7- Create a calculateSalary in the HourlyEmployee that multiplies the number_of_hours with the hourly_rate and display the salary on the screen
8- If the Employee is not an HourlyEmplyee or SalaryEmployee then his salary is fixed of 300
9- Create addEmployee that adds an employee to the list of employees in the Company
10- Create a method call it displayEmployees that displays the name and salary of all employees in the company
11- Create a method call it calculate_budget that displays the sum of all salaries of all employees in the company
payton
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