Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have done the Die Class. I just need help on thedriver class. Please take a lo

ID: 3615049 • Letter: I

Question

I have done the Die Class. I just need help on thedriver class. Please take a look. Below are the conditions thatmust be satisfied.
1. You will ask the user how many rolls they would like.
2. You will roll the die that many times.
3. Your die must use a constant to declare the max sides.
4. In an array, you will track how many times each rolloccurs.  
5. I (the professor) must be able to change the number of max sideswith no errors in the driver program.
4. Output a simple report with the details.

/* Hint */
The array element should correspond to the number from theroll.

SAMPLE OUTPUT:
Output: constant in the die class = 6
Enter the number of rolls
100
Roll number:1 times:10
Roll number:2 times:12
Roll number:3 times:12
Roll number:4 times:10
Roll number:5 times:10
Roll number:6 times:17

output - constant in the die class = 8
Enter the number of rolls
100
Roll number:1 times:10
Roll number:2 times:13
Roll number:3 times:12
Roll number:4 times:9
Roll number:5 times:10
Roll number:6 times:17
Roll number:7 times:14
Roll number:8 times:16 ======================================================================================================== Here is the Die Class:

publicclass Die { privatefinal int MAX = 6; private intfaceValue; //Constructor publicDie() { faceValue =1; } // Computesa new fac calue for this die and returns the result public introll() { faceValue =(int)(Math.random() * MAX) +1; returnfaceValue; } // Facecalue mutator public voidsetFaceValue (int value) { if (value> 0 && value <= MAX) faceValue =value; } // Facevalue accessor public intgetFaceValue() { returnfaceValue; } // Returnsa string representation of this die publicString toString() { Stringresult = Integer.toString(faceValue); returnresult; } } ======================================================================================================== Here is the beginning of the Driverclass:
importjava.util.Scanner; importjava.util.Random;
publicclass RollTheDie { publicstatic void main (String[] args) { intuserRolls = 0, count = 0; Randomgenerator = new Random(); Scannerscan = new Scanner (System.in); System.out.println ("How many rolls would youlike?"); userRolls =scan.nextInt();
} //End ofmain }//End of class I have done the Die Class. I just need help on thedriver class. Please take a look. Below are the conditions thatmust be satisfied.
SAMPLE OUTPUT:
Output: constant in the die class = 6
Enter the number of rolls
100
Roll number:1 times:10
Roll number:2 times:12
Roll number:3 times:12
Roll number:4 times:10
Roll number:5 times:10
Roll number:6 times:17

output - constant in the die class = 8
Enter the number of rolls
100
Roll number:1 times:10
Roll number:2 times:13
Roll number:3 times:12
Roll number:4 times:9
Roll number:5 times:10
Roll number:6 times:17
Roll number:7 times:14
Roll number:8 times:16 ======================================================================================================== Here is the Die Class:

publicclass Die { privatefinal int MAX = 6; private intfaceValue; //Constructor publicDie() { faceValue =1; } // Computesa new fac calue for this die and returns the result public introll() { faceValue =(int)(Math.random() * MAX) +1; returnfaceValue; } // Facecalue mutator public voidsetFaceValue (int value) { if (value> 0 && value <= MAX) faceValue =value; } // Facevalue accessor public intgetFaceValue() { returnfaceValue; } // Returnsa string representation of this die publicString toString() { Stringresult = Integer.toString(faceValue); returnresult; } } ======================================================================================================== Here is the beginning of the Driverclass:
importjava.util.Scanner; importjava.util.Random;
publicclass RollTheDie { publicstatic void main (String[] args) { intuserRolls = 0, count = 0; Randomgenerator = new Random(); Scannerscan = new Scanner (System.in); System.out.println ("How many rolls would youlike?"); userRolls =scan.nextInt();
} //End ofmain }//End of class ======================================================================================================== Here is the Die Class:

publicclass Die { privatefinal int MAX = 6; private intfaceValue; //Constructor publicDie() { faceValue =1; } // Computesa new fac calue for this die and returns the result public introll() { faceValue =(int)(Math.random() * MAX) +1; returnfaceValue; } // Facecalue mutator public voidsetFaceValue (int value) { if (value> 0 && value <= MAX) faceValue =value; } // Facevalue accessor public intgetFaceValue() { returnfaceValue; } // Returnsa string representation of this die publicString toString() { Stringresult = Integer.toString(faceValue); returnresult; } } ======================================================================================================== Here is the beginning of the Driverclass:
importjava.util.Scanner; importjava.util.Random;
publicclass RollTheDie { publicstatic void main (String[] args) { intuserRolls = 0, count = 0; Randomgenerator = new Random(); Scannerscan = new Scanner (System.in); System.out.println ("How many rolls would youlike?"); userRolls =scan.nextInt();
} //End ofmain }//End of class publicclass Die { privatefinal int MAX = 6; private intfaceValue; //Constructor publicDie() { faceValue =1; } // Computesa new fac calue for this die and returns the result public introll() { faceValue =(int)(Math.random() * MAX) +1; returnfaceValue; } // Facecalue mutator public voidsetFaceValue (int value) { if (value> 0 && value <= MAX) faceValue =value; } // Facevalue accessor public intgetFaceValue() { returnfaceValue; } // Returnsa string representation of this die publicString toString() { Stringresult = Integer.toString(faceValue); returnresult; } } ======================================================================================================== Here is the beginning of the Driverclass:
importjava.util.Scanner; importjava.util.Random;
publicclass RollTheDie { publicstatic void main (String[] args) { intuserRolls = 0, count = 0; Randomgenerator = new Random(); Scannerscan = new Scanner (System.in); System.out.println ("How many rolls would youlike?"); userRolls =scan.nextInt();
} //End ofmain }//End of class importjava.util.Scanner; importjava.util.Random;
publicclass RollTheDie { publicstatic void main (String[] args) { intuserRolls = 0, count = 0; Randomgenerator = new Random(); Scannerscan = new Scanner (System.in); System.out.println ("How many rolls would youlike?"); userRolls =scan.nextInt();
} //End ofmain }//End of class

Explanation / Answer

please rate - thanks had to add a accessor in the Die class public class Die { private final int MAX = 6; private int faceValue; // Constructor public Die() { faceValue = 1; } // Computes a new fac calue for this die and returns the result public int roll() { faceValue = (int)(Math.random() * MAX) +1; return faceValue; } // Face calue mutator public void setFaceValue (int value) { if (value > 0 && value