We use the Math.random class to generate a number from 1 to 6.
We do this again to generate the second number.
We have a total variable that gets the total of the 2 random numbers.
--------------------------------------------------------------------
public static void main(String[] args) {
//variables to hold numbers for the die and total
int no1 = (int)(Math.random()*6) + 1;
int no2 = (int)(Math.random()*6) + 1;
int total = no1 + no2;
//print out the result
System.out.println("Your first score: " + no1);
System.out.println("Your second score: " + no2);
System.out.println("The total is: " + total);
}
---------------------------------------------------------------------
That should be it, leave feedback! rickste_r!