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() { }

/** * Sets the location of this Button object to a new

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!