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

1 Expert Approved Answer
Step: 1 Unlock

class Box def setSizeself size selfsize size class Box def setPosit... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Computing and Programming in Pytho Questions!