The radius of the new bubble must be such that the new bubble's area is equal to the combined areas of the original two bubbles. Your magic method should return the new Bubble object. For instance,...

The radius of the new bubble must be such that the new bubble's area is equal to the combined areas of the original two bubbles. Your magic method should return the new Bubble object. For instance, new-bub = bub + big-bub should create a new bubble object new-bub centered at (1, -0.5) and with area equal to 7 +7.52 Note that we are simplifying reality by ignoring the technicalities of overlapping bubbles (in real life, if bubbles overlap then the total volume between them is not the sum of their volumes). Second, you will create a class called BubbleCollection, representing a collection of bubbles. This class will be shorter, and will make use of the Bubble class, so make sure to write the Bubble class first. Attributes and Methods • The constructor method must accept 1 argument from the user: bubble-list, which should rep- resent a list of Bubble objects. This argument should be assigned as the only attribute for this class. For instance, bub_col - BubbleCollection([bub, big-bub]) should create a bubble collection consisting of 2 bubbles (the ones defined on the previous page). Define a method called contains point. This method should be similar to and should make use of the method of the same name for the Bubble class, except instead of checking to see if the point (1, y) is contained in a single bubble you should check to see if the point is contained in ANY of the bubbles in the BubbleCollection object?

Dec 15, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here