Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

/** * Sets the location of this Button object to a new (x, y) * coordinate selec

ID: 3750998 • Letter: #

Question

/**
* Sets the location of this Button object to a new (x, y)
* coordinate selected at random. The x coordinate wil be in
* the range 100 to 500 inclusive, and the y coordinate will
* be the range 100 to 300 inclusive.
*/
public void changeLocation() {
  
}

2. Write the body of the changeLocation() method of the Button class. The changeLocation method sets the location of the Button Object to a new (x, y) coordinate selected at random. The x coordinate must be selected from the range 100 to 500 inclusive, and the y coordinate must be selected from the range 100 to 300 inclusive. List of methods to use: o Greenfoot.getRandomNumber setLocation

Explanation / Answer

Hi. please find the answer above.. In case of any doubts, please ask in comments. If the answer helps you, please upvote. I am in great need of upvotes. Thanks!