Question: Hw1: Reverse a single-dimensional array list (integer type) from a method. Write a program with a main method that inputs 5 integers 6,7,8,9,10 through user
Hw1: Reverse a single-dimensional array list (integer type) from a method. Write a program with a main method that inputs 5 integers 6,7,8,9,10 through user input and stores to an array then reverses the array list by using a method called reverse() shown as following and prints out the reversed list by using a method called printArray(). A method called "reverse" Function: reverse the original array list then return the reversed array list Note: no print in the method public static int[] reverse(intl] a) A method called "printArray". Function: print out the array elements public static void printArray(int[l a) Outputtwi-2018F (run) D run Enter 5 integer 670s 10 Reversed array llst: 109 76 BUILD SOCCESSPUL (cotal time: 9 seconda
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
