229k views
3 votes
Suppose we have a callback function paint that is called every time the mouse is moved. Which version of paint will draw a circle at the mouse's location?

1) Version 1
2) Version 2
3) Version 3
4) Version 4

User Faide
by
8.1k points

1 Answer

5 votes

Final answer:

Version 2 of the paint function will draw a circle at the mouse's location using the mouseX and mouseY variables.

Step-by-step explanation:

The version of the paint function that will draw a circle at the mouse's location is Version 2. In this version, we can use the mouseX and mouseY variables to get the current mouse position, and then use the ellipse function to draw a circle at that location.

User Denis Howe
by
8.5k points