I am in dire need of help. I can’t seem to figure this out andnobody has been able to help me. Program is java based and used ingreenfoot. The skeleton code below instructions is the only thingthat needs to be filled thanks.

Writing methods for the Batt class 1. Write the body of the act() method of the Ball class The act method simply calls the following methods in the order specified below 1. handleKeyPress 2. lookForButton 2. Write the body of the handleKeyPress() method of the Ball class The handleKeyPress method simply calls the following methods in the order specified below 1. checkLeftArrow 2. checkRightArrow 3. checkUpArrow 4. checkDownArrow 3. Write the body of the checkLeftArrow) method of the Ball class This method checks to see if the left arrow key is being pressed. If it is, then the ball sets its rotation angle to zero degrees and moves backward 5 units. If it is not being pressed, this method does nothing. List of methods to use o Greenfoot.isKeyDown o setRotation o move 4. Write the body of the checkRightArrow() method of the Ball class This method checks to see if the right arrow key is being pressed. If it is, then the ball sets its rotation angle to zero degrees and moves forward 5 units. If it is not being pressed this method does nothing. List of methods to use o Greenfoot.isKeyDown o setRotation O move

import greenfoot.*;

/**
*
*
*/

public class Ball extends Actor

{
/**
* Responds to motion control from the arrow keys and removes
* any buttons from the world when it intersects them.
*/
public void act() {

}   

/**
* Checks to see if the ball is “touching” an object of the Buttonclass.
* If it is, then the ball removes from the World a Button that ittouches.
* If the ball isn’t touching an object of the Button class, thenthis
* method does nothing.
*/
public void lookForButton() {

}

/**
* Handles input from the arrow keys.
*/
public void handleKeyPress() {

}

/**
* Checks to see if the left arrow key is being pressed.
* If it is, then the ball sets its rotation angle to zerodegrees
* and moves backward 5 units. If it is not being pressed,
* this method does nothing.
*/
public void checkLeftArrow() {

}

/**
* Checks to see if the right arrow key is being pressed.
* If it is, then the ball sets its rotation angle to zerodegrees
* and moves forward 5 units. If it is not being pressed,
* this method does nothing.
*/
public void checkRightArrow() {

}

/**
* Checks to see if the up arrow key is being pressed.
* If it is, then the ball sets its rotation angle to 270degrees
* and moves forward 5 units. If it is not being pressed,
* this method does nothing.
*/
public void checkUpArrow() {

}

/**
* Checks to see if the down arrow key is being pressed.
* If it is, then the ball sets its rotation angle to 90degrees
* and moves forward 5 units. If it is not being pressed,
* this method does nothing.
*/
public void checkDownArrow() {

}
}

public class Button extends Actor
{
/**
* Changes the location of this button approximately
* 2% of the time.
*/
public void act() {
  
}   
  
/**
* 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() {
}
}

Writing methods for the Batt class 1. Write the body of the act() method of the Ball class The act method simply calls the following methods in the order specified below 1. handleKeyPress 2. lookForButton 2. Write the body of the handleKeyPress() method of the Ball class The handleKeyPress method simply calls the following methods in the order specified below 1. checkLeftArrow 2. checkRightArrow 3. checkUpArrow 4. checkDownArrow 3. Write the body of the checkLeftArrow) method of the Ball class This method checks to see if the left arrow key is being pressed. If it is, then the ball sets its rotation angle to zero degrees and moves backward 5 units. If it is not being pressed, this method does nothing. List of methods to use o Greenfoot.isKeyDown o setRotation o move 4. Write the body of the checkRightArrow() method of the Ball class This method checks to see if the right arrow key is being pressed. If it is, then the ball sets its rotation angle to zero degrees and moves forward 5 units. If it is not being pressed this method does nothing. List of methods to use o Greenfoot.isKeyDown o setRotation O move Show transcribed image text Writing methods for the Batt class 1. Write the body of the act() method of the Ball class The act method simply calls the following methods in the order specified below 1. handleKeyPress 2. lookForButton 2. Write the body of the handleKeyPress() method of the Ball class The handleKeyPress method simply calls the following methods in the order specified below 1. checkLeftArrow 2. checkRightArrow 3. checkUpArrow 4. checkDownArrow 3. Write the body of the checkLeftArrow) method of the Ball class This method checks to see if the left arrow key is being pressed. If it is, then the ball sets its rotation angle to zero degrees and moves backward 5 units. If it is not being pressed, this method does nothing. List of methods to use o Greenfoot.isKeyDown o setRotation o move 4. Write the body of the checkRightArrow() method of the Ball class This method checks to see if the right arrow key is being pressed. If it is, then the ball sets its rotation angle to zero degrees and moves forward 5 units. If it is not being pressed this method does nothing. List of methods to use o Greenfoot.isKeyDown o setRotation O move