Add a method to the Turtle class to draw a rectangle given a width and height.

Note: New method at bottom


```
class MyTurtle(Turtle):

#Assumes the turtle starts looking straight up
def drawTri(self, size=60):
self.turn(30)
for i in range(3):
self.forward(size)
self.turn(120)

#Assumes the turtle starts looking straight up
def drawRect(self, width=100, height = 100):
self.turnRight()
self.forward(width)
self.turnRight()
self.forward(height)
self.turnRight()
self.forward(width)
self.turnRight()
self.forward(height)
```

Computer Science & Information Technology

You might also like to view...

In conjunction with the chief aim of regulating behavior, the outcomes of the governance controls should be specified at a level sufficient to support the specific measurement purposes of ____.

A. qualitative management B. measured management C. reactive management D. quantitative management

Computer Science & Information Technology

The correct syntax for passing an array as an argument in a method is:

a. a[] b. a() c. a d. a[0]..a[a.length]

Computer Science & Information Technology

Match each item with a statement below.

A. A TCP/IP network model layer that serves to move packets across one or more networks. B. An OSI network model layer responsible for data translation and encryption functions. C. An OSI network model layer responsible for networking support. D. An OSI network model layer responsible for establishing, maintaining, and terminating communications sessions between two systems. E. An OSI network model layer responsible for placing the transmission signal carrying the message onto the communications media. F. A TCP/IP network model layer that includes the Data Link layer and the Physical layer. G. An OSI network model layer responsible for communications between networks. H. An OSI network model layer responsible for providing users with a number of services they can use to exchange information. I. An OSI network model layer responsible for providing reliable end-to-end transfer of data between user applications.

Computer Science & Information Technology

You can convert the text in a slide placeholder to a SmartArt graphic

Indicate whether the statement is true or false

Computer Science & Information Technology