I am extremely new to programming and I have an issue trying to use a random. I am not looking for the direct answers, but maybe some guidance. I am working on an exercise that is supposed to help me learn the language, but I am struggling with trying to create a random that i need to call upon later in the program to create an average. I am supposed to create a program that allows a user to enter two dice sides. Then the system randomly rolls each dice multiple times and at the end averages the number rolled for each die. My program has a lot of comments so i can review it and know what function each line performs. Any assistance is greatly appreciated.
Thanks,
Anthony
import java.util.Random;
import java.util.Scanner;
public class Dice {
public static void main(String[] args) {
//int is the Primitive Data type and Diceone and Dicetwo are the Variables I created
int Diceone, Dicetwo;
/**int is the Primitive Data type and the DiceonefirstRoll is the variable for holding the number entered by the user*/
int DicetwofirstRoll, Dicetwosecondroll, DicetwothirdRoll;
//Calls the scanner class
Scanner scan = new Scanner (System.in);
//Sets Diceone to be the next integer entered via the keyboard
System.out.print ("How many sides does die 1 have?");
Diceone = scan.nextInt();
//Sets Diceotwo to be the next integer entered via the keyboard
System.out.print ("How many sides does die 2 have?");
Dicetwo = scan.nextInt();
//Closes the scanner for input
scan.close ();
//Do I need to call the random class like I do with the scanner in line 16?
//Creates random dice roll
System.out.print ("Die 1 first roll=");
Random DiceonefirstRoll= new Random(Diceone) + 1;
/**Trying make this so i can call it later. I am trying to have the # entered from Diceone and +1 due to not being able to receive a 0 on a die*/