Hi, I’m working on the Game Logic Pt 1 Tasks in the Java course (Introduction to android with Java).

I’m stuck on this activity:

Use Math.random() to generate a random decimal value.

All Java objects have access to the built-in `Math`

object.

And `Math`

provides a method named `random()`

which returns a randomly chosen `double`

value greater than or equal to 0, but less than 1.

For example, some possible return values are `0.2312`

, `0`

, or `0.999999`

.

Call `Math.random()`

within `generateRandomNumber()`

and save it to a local variable.

So far, I have done this:

public class MainActivity {

// Add generateRandomNumber() here

int generateRandomNumber(int max) {

double generateRandomNumber = Math.random();

return genrateRandomNumber;

}

// Add getGameOverMessage() here

}

But I get this error:

MainActivity.java:7: error: cannot find symbol

return genrateRandomNumber;

^

symbol: variable genrateRandomNumber

location: class MainActivity

1 error

I honestly am lost, and this specific project doesn’t have a cheat sheet. It’s the first time I’ve come across Math.random(). Any help would be incredible!