Question: Problem 1-Fix code Submit a working program called: ArrFix.java Fix the following code so that the program runs. The comments (in red) tell you what

 Problem 1-Fix code Submit a working program called: ArrFix.java Fix the

Problem 1-Fix code Submit a working program called: ArrFix.java Fix the following code so that the program runs. The comments (in red) tell you what the code should be doing. *Hi1: You may find it helpful to look up the ArrayList class online and look at the methods in the class. *Hint 2: You may also find it helpful to look at the EXTRAs section of ClassCode18. import java.util.ArrayList; import java.util.Scanner; public class ArrFix /*This method should return an integer entered by the user public static void getUserlnput() Scanner in-new Scanner(System.in); System.out.println("Enter a number or -1 to quit."); boolean done=true int n-0 /*This while loop should run until the user enters a number-once a number is entered, the loop should terminate while(done) try n-in.nextlnt catch(Exception e) System.out.println("That is not a number. Please enter an number."); in.nextLine) return done /*This method should take an ArrayList of integers and print out all elements*/ public static printOutList(a) System.out.printin("Currently in the list") for(int i=0;ica.s.ze(); ++) Each element is printed out/ System.out.printf("%d ", a); System.out.println(In")

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!