127k views
0 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?

a) paint(x, y)
b) paint(mouseX, mouseY)
c) paint(drawCircle)
d) paint()

1 Answer

0 votes

Final answer:

The correct option to draw a circle at the mouse's location is b) paint(mouseX, mouseY), where mouseX and mouseY represent the mouse coordinates.

Step-by-step explanation:

The version of paint that will draw a circle at the mouse's location when called every time the mouse is moved is b) paint(mouseX, mouseY). This suggests that the function paint is designed to take two arguments, mouseX and mouseY, which are the x and y coordinates of the mouse's position on the screen. By passing these coordinates to the function, a circle can be drawn at the exact location where the mouse is pointing.

User Miggy
by
9.2k points