Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in Python Write a program randomCirclesAnimation(picture, iterations) which takes as input a picture and the number of random circles to be drawn. Create

This is in Python

Write a program randomCirclesAnimation(picture, iterations) which takes as input a picture and the number of random circles to be drawn. Create an animation of black circles at random positions and random radii drawn on the provided picture.

  • Use import random before you start writing your program.
  • Initialize all variables you may need.
  • Create a loop counting the iterations. Inside this loop, use random.randint to create random coordinates x and y for the center of a circle, and a random radius between 1 and 20 pixels wide. Use addOvalFilled to draw the circles. This function will clip the filled circle automatically, so you do not have to worry about parts of the circle being outside your picture. Repaint your picture after a circle has been drawn.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago