0

**Here is what I am trying to accomplish with Java:**

A simple guessing game asks the player to guess a number between 1 and 50. Hints are returned depending on how far from the number the guess is. Add other methods for playing the game omitted--you need not supply any of them.

20 or more above the number: The hint is "Burning Hot"

10 to 19 above the number: The hint is "Hot"

5 to 9 above the number: The hint is "Warm"

4 below the number to 4 above: The hint is "Pleasant"

5 to 9 below the number: The hint is "Cool"

10 to 19 below the number: The hint is "Cold"

20 or more below the number: The hint is "Ice Cold"

**Here is my code so far, but I am having a hard time from this point:**

```
import java.util.Random;
/**
A class to store a number to guess and return a closeness hint
*/
public class GuessNumber
{
private int number;
/**
Construct an GuessNumber with a random value between 1 and 50
*/
public GuessNumber()
{
Random r = new Random();
number = r.nextInt(50) + 1;
}
/**
Determine how close the guess is and return a hint
@return a string describing, in terms of hotness or coldness, how
close the guess is to the number
*/
public String howClose(int guess)
{
//I need code here but cannot quite get it
}
// This method is used to check your work
public static String check(int number, int guess)
{
GuessNumber gn = new GuessNumber();
gn.number = number;
return gn.howClose(guess);
}
}
```