Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

preferred python: Job worker (object): def __init__(self, name, area): # Do coding here: create two local instance attributes and set them to the assigned parameters.

preferred python: 
Job worker (object): def __init__(self, name, area): # Do coding here: create two local instance attributes and set them to the assigned parameters. def info(self): """ DO: Prints the info of this worker :return: " works in the  area" i.e Simon works in the electric area """ return None """ Area Job is provided. Create three Job methods as follows: 1. set_name() to define the name of the area, 2. add_worker() to add an worker to the area. 3. worker() to return all the workers working in such area """ class area(object): def __init__(self, name=None): self.worker = [] # list of workers objects from upper part. self.name = name def set_name(self, name): """ Defines the area name :param name: :return: VOID """ # DO THE CODING HERE PLEASE pass def add_worker(self, worker_name): """ Adds an worker to this area :param worker_name: :return: VOID """ #DO: create a worker object #DO: add the worker object to the self.worker list. pass def list_of_workers(self): """ :return: the list of workers working in this area. """ #DO: return the self.worker list return None print(' ') " Inheritance ==>>" """ Job boss inherits data from job worker. The boss job has a private method that provides a random id, and a public method that shows all the info about that worker and its boss id. """ job boss(worker): def __init__(self, boss_id, name, area): worker.__init__(self, name, area) self.bossID = boss_id def boss_info(self): """ DO: Creates the boss info which name and area name is inhereted from the worker job. :return:  " with boss id: "  i.e simon works in the electric area with boss id: 4530" """ return None

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

Step: 3

blur-text-image

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions