Hey guys. I seem to be having a problem with my code.
import java.util.Scanner;
public class fishingGames
{
public static void main(String[] args)
{
int totalPoints = 0;
String items;
int Sides = 6;
boolean playAgain = true;
Scanner keyboard = new Scanner(System.in);
Dice = new Dice(Sides);
while (playAgain)
{
fishing.roll();
if (fishing.getvalue()==1)
{
fish = "A piece of plastic";
totalPoints+= fishing.getvalue();
}
else if(fishing.getValue()==2)
{
fish= "A tiny fish";
totalPoints+=fishing.getValue();
}
else if(fishing.getValue()==3)
{
fish = "A common fish";
totalPoints+= fishing.getValue();
}
else if(fishing.getValue()==4)
{
fish = "A catfish";
totalPoints+= fishing.getValue();
}
else if(fishing.getValue()==5)
{
fish = "A rainbow fish!";
totalPoints+= fishing.getValue();
}
else if(fishing.getValue()==6)
{
fish = "A very rare fish!!!!!";
totalPoints+= fishing.getValue();
}
System.out.println("You caught" + fish);
System.out.println("Would you like to keep fishing? [Y or N]");
char pick = scanner.next().charAt(0);
if(pick =='n')
playAgain =false;
}
System.out.println("Your points total up to: " + totalPoints);
}
}
import java.util.Random;
public class die
{
private int sides;
private int value;
public die(int numbSides)
{
sides = numSides;
roll();
}
public void roll()
{
Rand random = new Random();
value = rand.nextInt(Sides)+1;
}
public int getSides()
{
return Sides;
}
public int getValue()
{
return value;
}
}
i keep getting this error, class, interface, or enum expected for line 77. I am sorry if this problem is very easy to solve, I am just starting to learn java and I would appreciate any help I can recieve.
Thank you