loops - Pointing to specific line in program with if statement? Java -
I have a program that tells the user to input values between 1 and 6. However, if they do not ask in the middle of that category, I want to ask the user again for input to the program. I have other code inside the method, so I can not just point out the method
System.out.print ("Now enter the number between 1 and 6"); DieNumber = keyboard.nextInt (); If (death == 1) {doon (pane); } And if (dieember == 2) {drawTwo (pane); } And if (Maranambar == 3) {W. Darren (pane)}} and if (dieember == 4) {drawing (panels); } And if (dieember == 5) {drawing (panels); } And if (dieember == 6) {drops (panels); }
ask each user again when entering a number Loop is required for
System.out.print ("Now enter a number between 1 and 6"); DieNumber = keyboard.nextInt (); While (Maranambar> 6) {System.out.print ("Now enter a number between 1 and 6"); DieNumber = keyboard.nextInt (); } If (Maranambar == 1) {doon (panels); } And if (dieember == 2) {drawTwo (pane); } And if (Marnemar == 3) {WTTE (pane); } And if (Maranembar == 4) {drawFour (pane); } And if (dieember == 5) {drawing (panels); } And if (dieember == 6) {drops (panels); }
Comments
Post a Comment