Question: Make some modifications to Joe the Box. Add a method to Box named setColor that takes a color as input, then makes the input
Make some modifications to Joe the Box.
• Add a method to Box named setColor that takes a color as input, then makes the input color the newcolor for the box. (Maybe setDefaultColor should call setColor?)
• Add a method to Box named setSize that takes a number as input, then makes the input number the new size for the box.
• Add a method to Box named setPosition that takes a list or tuple as a parameter, then makes that input the new position for the box.
• Change init so that it uses setSize and setPosition rather than simply setting the instance variables.
Step by Step Solution
3.41 Rating (167 Votes )
There are 3 Steps involved in it
class Box def setSizeself size selfsize size class Box def setPosit... View full answer
Get step-by-step solutions from verified subject matter experts
