so basically all you need to do is assign a set of numbers that Math.random() covers, to specific strings.
First of all when working with Math.random its importat to know that it comes up with a number between 0 and 1. Small numbers such as these can be difficult to manage so in my experience i always multiply it by 100. Making it a number between 1 and 100.
double randomNum = (Math.random() * 100);
Now we can assign the strings.
For example is you wanted to have 4 different strings that is could print out, you would need to assign different numbers to a string.
the "guts" of the code should look similar to whats below:
if(randomNum > 0 && <= 25)
{
System.out.println("No");
}
else if(randomNum > 25 && randomNum <= 50)
{
System.out.println("Yes");
}
else if(randomNum > 50 && randomNum <= 75)
{
System.out.println("Maybe");
}
else if(randomNum > 75 && randomNum <= 100)
{
System.out.println("Unclear, ask again.");
}
Hope this helps!!