need a help in this dice program, having problem with looping
This is a client program
here i need to ask user if he/she wants to play the dice roller ..if yes then start gaem.
After one game i have to ask weather he/she wants to play again.
mport java.util.Scanner;
publicclass DiceTester
{
publicstaticvoid main(String [] args)
{
Dice dice1 =new Dice();
Dice dice2 =new Dice();
dice1.roll();
dice1.roll();
int x = dice1.getface();
int y = dice2.getface();
char yes;
System.out.println (" Do you want to play a rolling game?");
System.out.println ("\nIf yes then press \"Y\" or \"y\" > " );
Scanner scan =new Scanner (System.in);
yes = scan.next().charAt(0);
if (yes =='y'|| yes =='Y')
{
System.out.println("The result of the first dice rolled is > " +x);
System.out.println("The result of the second dice rolled is > "+y);
int Sum = x+y;
System.out.println("The sum of two dice rolled is " +Sum);
}
else
{
System .out.println("Good buy");
}
}
}

