Make some modifications to Joe the Box.

1. Add a method to Box named setColor that takes a color as input, then makes the input color the new color for the box. (Maybe setDefaultColor should call setColor?)
2. Add a method to Box named setSize that takes a number as input, then makes the input number the new size for the box.
3. 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.
4. Change init so that it uses setSize and setPosition rather than simply setting the instance variables.


1. ```
class Box:
def __init__(self):
self.setDefaultColor()
self.size=10
self.position=(10,10)
def setColor(self, color):
self.color = color
def setDefaultColor(self):
self.setColor(red)
```

2. ```
class Box:
def setSize(self, size):
self.size = size
```

3. ```
class Box:

def setPosition(self, position):
self.position = position
```

4. ```
class Box:
def __init__(self):
self.setDefaultColor()
self.setSize(10)
self.setPosition((10,10))
```

Computer Science & Information Technology

You might also like to view...

Many Facebook games are social games

Indicate whether the statement is true or false

Computer Science & Information Technology

List and describe the major parts of an access point.

What will be an ideal response?

Computer Science & Information Technology

How might user data be validated?

What will be an ideal response?

Computer Science & Information Technology

Which type of NoSQL database is Neo4j?

A. Document-oriented B. Relational C. Key-value D. Column family E. Graph

Computer Science & Information Technology