Question: public static void main(String[] args) { int gameNum; Scanner scanner = new Scanner(System.in); System.out.println(Enter number of games you want to play:) gameNum = scanner.nextInt(); int

public static void main(String[] args) { int gameNum; Scanner scanner = new Scanner(System.in); System.out.println("Enter number of games you want to play:") gameNum = scanner.nextInt(); int firstNum = 0; int secondNum = 0; int thirdNum = 0; for (int i = 0; i<= gameNum; i++) { System.out.printf("Enter first number of game%d: ", i) firstNum = scanner.nextInt(); System.out.printf("Enter second number of game%d: ", i) secondNum = scanner.nextInt(); System.out.printf("Enter third number of game%d: ", i) thirdNum = scanner.nextInt(); } 

This is what I got so far. But I need this program to do these. If sum of firstNum, secondNum and thirdNum are less than 10, prompt user to do it again. And there more features, but I am not sure how to describe, but these are expected outcome.

Enter number of games you want to play: 3 Enter first number of game1: 2 Enter second number of game1: 3 Enter third number of game1: 8 Enter first number of game2: 5 Enter second number of game2: 1 Enter third number of game2: 1 Wrong input do you want to do it again? yes Enter first number of game2: 5 Enter second number of game2: 5 Enter third number of game2: 1 Enter first number of game3: 5 Enter second number of game3: 1 Enter third number of game3: 1 sum of first numbers are 12 

Like this, delete the values with wrong input during the game. However, if user says no to wrong input, also use wrong input to calculate sum.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!