Question: Java coding Exercise 20: Array Methods Folder name A170 E20 YourLastName Your FirstName For this exercise, you need to implement seven (7)methods using the ex23
Exercise 20: Array Methods Folder name A170 E20 YourLastName Your FirstName For this exercise, you need to implement seven (7)methods using the ex23 array methods project. The project contains a main method that declares an array of capacity 20 and calls the methods you need to implement. Do NOT modify the main method. These are the methods you need to implement: Method processArray o Parameter: An array of integers. o Return type: An integer. o Asks the user to enter positive integers, specifying not to enter more than the maximum allowed (this is set by the constant MAX) and when to quit (see output below for details). o Uses a WHILE loop to read the integers entered by the user, o You need to keep track of how many numbers the user enters so that you can returm the number of elements in the array. Method askTolnsert o Parameters: An array of integers and an integer that stores thenumber of elements in the array. o This is a void method o Asks the user which number to add to the array and in which index. Calls the method insert. Method insert o Parameters: An array of integers, an integer that stores the number of elements in the array, an integer that stores the number to insert, and an integer that stores the index where the number will be inserted. o This is a void method. o Inserts the given number at the given index. o Do not worry about increasing the number of elements. This is already implemented in the main method when the askTolnsert method is called. Method askTORemove o No parameters. o Return type: An integer that stores the number to remove. o Asks the user which number to remove from the array. Method search o Parameters: An array of integers,an integer that stores the number ofelements in the array, and the integer to search for. o Return type: An integer that stores the index where the number is in the array, or-1 ifthe number is not found. o Uses a WHILE loop to find the element. The while loop should STOP when the element is found or when the search has reached the end of the array. Method remove
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
