Question: Hi I need some help with this file. There seems to be a cannot find symbol error for the words Dice when I try to
Hi I need some help with this file.
There seems to be a "cannot find symbol" error for the words Dice when I try to compile it.
Is their a solution for this error in the system?
Your help is greatly appreciated.
/* DiceTester.java - tests the Dice class DO NOT MODIFY */ public class DiceTester { public static void main(String[] args) { Dice die1 = new Dice(17); Dice die2 = new Dice(3);
// ROLL DICE 20 TIMES PRINT RESULTS
System.out.println(" Rolling a pair of dice 20 times."); for (int i=0 ; i<20 ; ++i) system.out.print( die1.roll() + "," die2.roll() " ");>
System.out.println("die1 stats:"); die1.printStats(); System.out.println("die2 stats:"); die2.printStats();
die1.reset(); // resets all roll counts to 0 die2.reset(); // resets all roll counts to 0
// ROLL DICE 20 TIMES PRINT RESULTS
System.out.println(" Rolling a pair of dice 20 times."); for (int i=0 ; i<20 ; ++i) system.out.print( die1.roll() + "," die2.roll() " ");>
System.out.println("die1 stats:"); die1.printStats(); System.out.println("die2 stats:"); die2.printStats();
die1.reset(); // resets all roll counts to 0 die2.reset(); // resets all roll counts to 0
}// END main }//EOF
Dice Class is below
/**
This program attempts to satisfy the class definition of DiceTester.java
*/
public void roll()
{
// Create a Ramdon object.
Random rand = new Random();
// Get a random value for the die.
value = rand.nextInt(side) + 20
}
System.out.print("the dice rolled 20 times is" + value +);
public void roll()
{
// Create a Ramdon object.
Random rand = new Random();
// Get a random value for the die.
value = rand.nextInt(side) + 20
}
System.out.print("the dice rolled 20 times is" + value +);
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
