Question: i just need the implementation code thats all 1 package console_apps; 2 30 import java.util.Scanner: 6 7 public class GetAllPrefixesApp { 8 96 public static

![public static void main(String[] args) { 10 Scanner input = new Scanner(System.in);](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f945a203314_32166f945a19b51e.jpg)
1 package console_apps; 2 30 import java.util.Scanner: 6 7 public class GetAllPrefixesApp { 8 96 public static void main(String[] args) { 10 Scanner input = new Scanner(System.in); 11 12 /* Prompt the user for an array of numbers. */ 13 System.out.println("How many numbers do you want to input?"); int howMany = input.nextInt(); 15 int[] numbers = new int [howManyl; 16 int i = 0; while(i "); input.close(); 31 32 33 34 35 36 37 38 } 39 40 } 41 * * Input parameters: *numbers': an array of integers * Assumptions: * - numbers. length >= 1 * Refer to you lab instructions for what the method should return. */ public static String() getallPrefixes(int[] numbers) { String[] result = null; /* Your implementation of this method starts here. * Recall from Week 1's tutorial videos: * 1. No System.out.println statements should appear here. Instead, an explicit, final 'return statement is placed for you. * 2. No Scanner operations should appear here (e.g., input.nextInt()). Instead, refer to the input parameters of this method. */ * Problem. You are asked to implement a utility method which takes us input an array of integers and returns another array of strings, each of which denoting a non-empty prefix of the input array. For example, if the input array is: Then the output or returned array of string values is: Note that the length of the output array is equal to the length of the input array. Also, elements in the output array are "sorted by the lengths of the prefixes (eg, the first element is the prefix of length 1, the second element is the prefix of length 2). Testing. Your goal is to first pass all tests related to this method in the JUnit test class TestUtilities. You are encouraged to write additional JUnit tests. These tests document the expected values on various cases: study them while developing your code. However, use the console application class GetAllPrefixesApp if you wish (eg, use the input and expected values from the JUnit tests). Here is an example run: How many numbers do you want to input? 5 Enter input 1: 3 Enter input 2: 1 Enter input 3: 4 Enter input 4: 2 Enter input 5: 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
