Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

how to rerun this program

OpenStudy (anonymous):

import java.util.Scanner; public class OccuranceOfMaxNumbers { public static void main (String [] args) { //Creating Scanner Scanner input = new Scanner (System.in); int i, rerun; int max = 0; int count = 0; //User input System.out.print("Enter numbers: "); i = input.nextInt(); //To find largest number and its occurance while (i != 0) { if (i > max) { max = i; count = 1; } else if (i == max) { count++; } i = input.nextInt(); } //Output System.out.println("The largest number is " + max); System.out.println("The occurance count of the largest number is " + count); } }

OpenStudy (anonymous):

i need help to rerun this program so that the user can rerun it with different inputs in the same run

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!