Question: Create a class Path which has the following attributes: length width people - list of Person objects It should also have the following methods: add
Create a class Path which has the following attributes:
length
width
people list of Person objects
It should also have the following methods:
addperson which adds a Person object to this pathway if it has capacity.
The capacity of a path in number of people is the length width If there is no
capacity, the person is not added and return False. If there is capacity, add the
person and return True.
gettraffic which returns the proportion of capacity in the path currently
being used, representing how busy the path is This is the number of people
divided by capacity of the path.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
