Question: Implement the following class diagrams as follows. Each class implement the Displayable abstract class and the display method should display all the current objects and
Implement the following class diagrams as follows. Each class implement the Displayable abstract class and the display method should display all the current objects and its superclass objects information. Define appropriate arguments for __init__ so that all the objects can be created properly. Define appropriate public properties to access private attributes in other classes. But, you cannot provide a public getter property for any attributes whose types are list or dict, so you must implement __iter__ and __next__ methods for them. Create a main method to test all your classes and their methods thoroughly. Displayable (abstract) + display(): None = 0 AbstractCompany (abstract) #_max_num_employees = 10 : int + get_employee_name_list() list(str] = 0 StockBusiness -__research_tool: str __commission_rate: float +_int_(???): None + trade(stock_name: str, num_shares: int): None # print something like "trading Apple 1000 shares Employee -__empld: int -__name: str -__salary: float -__title: str # Officer, Supervisor, Manager +__int (???): None Company -__comp_name: str -__employees: list[Employee] _int_(???): None +add_employee (employee: Employee): None # need to check whether the list is full or not using _max_num_employees attribute of its superclass +remove_employee (empid : int): None +update_employee_title(empid: int, title: str): None + remove_all_employees_by_title(title: str): None + __iter_() + _next_() TradingCompany -__product_type: str e.g. Stocks, Futures, Indices, Commodities _num_of_offices: int +_int_(???): None +get_employees_high_salary(limit: float): list[Employee] # employees who have salary more than limit + get_employees_by_title(): dict[str, list(str]] # dictionary of items. Each item's key is employee's title, and item's value is a list of employee names who have that title.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
