Help required please
I am working on a program to roll a set of dice 1000 times and count the occurences of the doubles. I am also required to count the occurences of each of the doubles but I am getting an error on compile my code is:
publicclass TestDice
{
publicstaticvoid p(String s)
{
System.out.print(s);
}
publicstaticvoid main(String[] args)
{
PairOfDice dice;
int noRolls,doubles=0;
int bin1=0;
dice =new PairOfDice();
p("\n\n");
for (noRolls=0; noRolls<100; noRolls++)
{
dice.roll();
p("" + dice.getDice1() +"," + dice.getDice2() +"\t");
if(dice.getDice1() == dice.getDice2())
doubles++;
if(dice.getDice1() && dice.getDice2() == 1)
bin1++;
}
p("\n\nThere was " + doubles +" Doubles \n\n");
p("\n\nThere was " + bin1 +" Double 1's \n\n");
}
}
the compiler output is saying:
public class TestDice
{
public static void p(String s)
{
System.out.print(s);
}
public static void main(String[] args)
{
PairOfDice dice;
int noRolls,doubles=0;
int bin1=0;
dice = new PairOfDice();
p("\n\n");
for (noRolls=0; noRolls<100; noRolls++)
{
dice.roll();
p("" + dice.getDice1() + "," + dice.getDice2() + "\t");
if(dice.getDice1() == dice.getDice2())
doubles++;
if(dice.getDice1() && dice.getDice2() == 1)
bin1++;
}
p("\n\nThere was " + doubles + " Doubles \n\n");
p("\n\nThere was " + bin1 + " Double 1's \n\n");
}
}
any help would be greatly appreciated thanks

