hi,
im trying to create a program that records the amount of times a number was rolled using input from the user. currently it is only printing 1 number and i need it to print 6. i am only beginning to study java so im lacking knowledge a bit. any help would be appreciated. i am expected to use Math.random() so no "import java.util.Random;" here is my code:
class DiceRandom
{
static int random()
{
int die1 = (int)(Math.random()*6) + 1;
return die1;
}
public static void main(String[] args)
{
System.out.println("How many times do you want to roll the dice?");
int input = Console.readInt();
System.out.println("you rolled the dice "+input+" times.");
int [] mark = {random()};
int count = input;
for(int i = 0; i < mark.length; i++)
while(mark[i] >= 6)
count++;
System.out.println(count*random());
}
}