Question: /** * Sets the location of this Button object to a new (x, y) * coordinate selected at random. The x coordinate wil be in
/** * 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
