I am supposed to be able to throw the dice and then whenever it hits 7 I should add one to the counter. After I hit 100 7s I need to take that amount and find out the odds and display those?
ANy ideas. this is what I have so far. I am stuck where I can't take the amount of throws and count them.. Thanks
Phil
import java.util.*;
public class number_one
{
public static void main(String[] args)
{
int counter = 0, toss = 0, tossseven = 0, odds = 0, randomdice = 6;
while (counter > 100)
{
randomdice = (int)(Math.random() * 6 + 1);
counter++;
}
odds = toss / tossseven;
System.out.println (randomdice);
System.out.println (counter);
}
}
ANy ideas. this is what I have so far. I am stuck where I can't take the amount of throws and count them.. Thanks
Phil
import java.util.*;
public class number_one
{
public static void main(String[] args)
{
int counter = 0, toss = 0, tossseven = 0, odds = 0, randomdice = 6;
while (counter > 100)
{
randomdice = (int)(Math.random() * 6 + 1);
counter++;
}
odds = toss / tossseven;
System.out.println (randomdice);
System.out.println (counter);
}
}