Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Python 3 or above Write a function named q40 that creates a 300 x 300 Graphics window and draws a blue filled Circle object

image text in transcribed

Use Python 3 or above

Write a function named q40 that creates a 300 x 300 Graphics window and draws a blue filled Circle object (radius 20) in the center of the window and a Text object near the top of the the Window as shown here. The function should wait for the user to click in the window before continuing. Once a mouse click is detected in the Graphics window, the Text object should be removed and the Circle should begin to moving side to side, "bouncing" or changing direction Me Click to Start edge of the Graphics window. When a mouse click is detected in the Graphics window, the q40 function should determine if the location of mouse click is within the boundaries of blue Circle object. .If a mouse click is within the blue Circle, it should immediately change direction and starts moving "up and down" and continue to bounce when it encounters the top and bottom edges of the Graphics window. .Each additional mouse click within the boundaries of the Circle object will alternate the direction of movement between "side to side" and "up and down" After a total of five (5) mouse clicks inside the Circle object, the function should close the Graphics window and end. NOTE: The arrows shown indicate only the direction of movement and should not be drawn. Write a function named q40 that creates a 300 x 300 Graphics window and draws a blue filled Circle object (radius 20) in the center of the window and a Text object near the top of the the Window as shown here. The function should wait for the user to click in the window before continuing. Once a mouse click is detected in the Graphics window, the Text object should be removed and the Circle should begin to moving side to side, "bouncing" or changing direction Me Click to Start edge of the Graphics window. When a mouse click is detected in the Graphics window, the q40 function should determine if the location of mouse click is within the boundaries of blue Circle object. .If a mouse click is within the blue Circle, it should immediately change direction and starts moving "up and down" and continue to bounce when it encounters the top and bottom edges of the Graphics window. .Each additional mouse click within the boundaries of the Circle object will alternate the direction of movement between "side to side" and "up and down" After a total of five (5) mouse clicks inside the Circle object, the function should close the Graphics window and end. NOTE: The arrows shown indicate only the direction of movement and should not be 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 Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

=+2 Is the decision sustainable in the long run?

Answered: 1 week ago

Question

=+1 Is the decision fair to employees?

Answered: 1 week ago