Part A Create a UML diagram for the two classes contained in the Python files listed below. NO GRAPHIC FILE. participant

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Part A Create a UML diagram for the two classes contained in the Python files listed below. NO GRAPHIC FILE. participant

Post by answerhappygod »

Part A
Create a UML diagram for the two classes contained in the Python
files listed below. NO GRAPHIC FILE.
participant.py
class Participant:
def __init__(self, name, age, address):
self._name = name
self._age = age
self._street_address = address
self._test = 'test'
self.__test2 = 'test'
@property
def test2(self):
return self.__test2
@property
def name(self):
return self._name
@property
def age(self):
return self._age
@property
def street_address(self):
return self._street_address
def __str__(self):
return '{} {} {}'.format(self.name,
self.age, self.street_address)
runner.py
import participant
class Runner(participant.Participant):
def __init__(self, runner_name, runner_age,
runner_address, start_location,finish_location):

participant.Participant.__init__(self,runner_name,runner_age,runner_address)
self._start_location =
start_location
self._finish_location =
finish_location
@property
def start_location(self):
return self._start_location
@property
def finish_location(self):
return self._finish_location
def __lt__(self,other_runner):
return self.name <
other_runner.name
Part B
Write a client script (runner_client.py) that
uses the runner class. The program will create a list of five
runners. Once the runners are created, the program will print
each runner’s details.
Your program logic must include the
following:
2. When the loop completes, display
the runners(One runner per line)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply