A player plays a game with three dices. He can get a particular number in many ways (except
1 and 2). Write a blue j program to determine the number of ways to get a specific number, when
three dices are rolled together.
please help
Answers
Answered by
1
Answer:
Hope the program given below answers your question. I didn't quite understand it properly tho.
Main Code :
public class Random_dice
{
public static int randomMethod(int max, int min) {
return ((int)(Math.random() * (max - min))) + min;
}
public static void main (String[]args) {
double ranNum_1, ranNum_2, ranNum_3;
ranNum_1 = randomMethod(6,3);
ranNum_2 = randomMethod(6,3);
ranNum_3 = randomMethod(6,3);
System.out.println((int)ranNum_1);
System.out.println((int)ranNum_2);
System.out.println((int)ranNum_3);
}
}
Similar questions