Please help with assignement
ok so i have this assignment and im nearly 80 % done. here's what i have to do: Play a number guessing game. This game is to have the computer pick a number
between 1 and 30. Take this number, and pass it into a method that allows for the user
to guess it. Let the computer tell the user to pick a higher or lower number if they guess
wrong. If the guess is right, use another method to pick one of 3 random responses
congratulating them.
here is my code so far:
import java.awt.*;
import hsa.Console;
publicclass CPTaa
{
static Console c;// The output console
publicstaticvoid main (String[] args)
{
c =new Console ();
int dice1, dice2, dice4, dice5, num;
double dice3;
dice1 = (int) (Math.random () * 100) + 1;
c.print (dice1);
dice2 = 0;
num = 100;
for (int i = 0 ; i < num ; i++)
{
c.print ("Enter a number from 1 to 100: ");
dice2 = c.readInt ();
if (dice2 > dice1)
c.print ("Smaller ");
if (dice2 < dice1)
c.print ("Higher ");
if (dice1 == dice2)
{
c.print ("You got it right");
}
}
}
}
i need to do the 3 random congratulations part

