Use the methods in the Picture class to draw a rainbow.

Note: One could make use of arc as in drawRainbow or circle (with part offscreen or “erased”) as in drawRainbow2 for the smile.


```
def drawRainbow():
canvas = makeEmptyPicture(100,100)
canvas.addArcFilled(red, 0, 50, 100, 80, 0, 180)
canvas.addArcFilled(orange, 5, 55, 90, 70, 0, 180)
canvas.addArcFilled(yellow, 10, 60, 80, 60, 0, 180)
canvas.addArcFilled(green, 15, 65, 70, 50, 0, 180)
canvas.addArcFilled(blue, 20, 70, 60, 40, 0, 180)
canvas.addArcFilled(makeColor(255, 0, 255), 25, 75, 50, 30, 0, 180)
canvas.addArcFilled(white, 30, 80, 40, 20, 0, 180)
canvas.show()

def drawRainbow2():
canvas = makeEmptyPicture(100,100)
canvas.addOvalFilled(red, 0, 50, 100, 100)
canvas.addOvalFilled(orange, 5, 55, 90, 90)
canvas.addOvalFilled(yellow, 10, 60, 80, 80)
canvas.addOvalFilled(green, 15, 65, 70, 70)
canvas.addOvalFilled(blue, 20, 70, 60, 60)
canvas.addOvalFilled(makeColor(255, 0, 255), 25, 75, 50, 50)
canvas.addOvalFilled(white, 30, 80, 40, 40)
canvas.show()
```

Computer Science & Information Technology

You might also like to view...

Show that byzantine agreement can be reached for three generals, with one of them faulty, if the generals digitally sign their messages.

What will be an ideal response?

Computer Science & Information Technology

Input a date MM DD YY from input stream

What will be an ideal response?

Computer Science & Information Technology

Use ________ if you have mostly numeric data and may require complex charts and graphs

Fill in the blank(s) with correct word

Computer Science & Information Technology

Case 7-2Ryan is working with arrays in JavaScript for the first time. He is creating a cycling banner ad for his bicycle repair shop.Ryan's ad includes four images so he creates a four-element array. The correct indices for a four-element array in JavaScript are ____.

A. 0, 1, 2, and 3 B. 1, 2, 3, and 4 C. 2, 4, 6, 8 D. -1, 0, +1, +2

Computer Science & Information Technology