Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 8 - Data Abstractions - Chapter Review Problems - Page 412: 42

Answer

See the explanation

Work Step by Step

Here's a Python implementation of the classes and method for this problem: ```python class Employee: def __init__(self, name): self.name = name self.is_available = True def handle_call(self): self.is_available = False def end_call(self): self.is_available = True class Respondent(Employee): def __init__(self, name): super().__init__(name) class Manager(Employee): def __init__(self, name): super().__init__(name) class Director(Employee): def __init__(self, name): super().__init__(name) class CallCenter: def __init__(self): self.respondents = [] self.managers = [] self.directors = [] def add_respondent(self, respondent): self.respondents.append(respondent) def add_manager(self, manager): self.managers.append(manager) def add_director(self, director): self.directors.append(director) def dispatch_call(self): for respondent in self.respondents: if respondent.is_available: respondent.handle_call() return respondent for manager in self.managers: if manager.is_available: manager.handle_call() return manager for director in self.directors: if director.is_available: director.handle_call() return director return None ``` This implementation defines classes for employees at different levels - Respondent, Manager, and Director, each inheriting from the base class Employee. The `dispatch_call` method checks the availability of each employee starting from respondents to directors and assigns the call to the first available employee.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.