How to continue loop java -


My program will not do that I need it and I got stuck on this issue for six hours. It indicates to the user how many times they want to toss a coin, according to the program, how many heads and tails were thrown, and with the total head and tail as well as the percent which had been rolled into the head, my problem is That it goes through for the first time once the loop ends it just stops and the user does not indicate any other number to choose or leave the program For the sector and press 0 to return to the main menu, I can how to fix it myself? Apart from this, how can I get the option of returning to the second loop? I have tried the break method and it does not work for me. I do not know if I'm actually lost. How can I make it, this loop continues to toss the coin and still ask users how often they want to toss. While at the same time pressing Just 0 and allowing it to exit the loop to return to the main menu? I did not post that code here, but it is a little loop with various sub-options / games.

  if (anotherScanner.hasNext ("t | T")) {c = anotherScanner.next (); UsersSelection = True; Println (""); System.out.println ("cone toss simulators"); Println (""); System.out.println ("0 to leave. How many toss?"); Random rand = new random (); Float head count = 0; Float tail number = 0; Scanner Scanman = New Scanner (System.in); Int numero = scanMan.nextInt (); Boolean headrestel; For (int j = 0; j and lt; number; j ++) {if (numero == 0) {break; } Headrights = Rand NX BlueOilion (); If (headlines == true) {headsCount ++; } Other {tail number ++; System.out.println (headCount + "heads and" + tail number + "tail means" ++ "(headcount / (circount + tail number) * 100 +"% head ")); }}}}  

User input code should also be in the loop.


Comments