Question: undefined Assignment Requirements For this assignment you are given the following files: Assignment06.java (you must complete this file) Problem Description and Given Info Within the
undefined
Assignment Requirements For this assignment you are given the following files: Assignment06.java (you must complete this file) Problem Description and Given Info Within the Assignment06.java file, you must define the following methods. In the main method, you may write any code that wish to test the methods you have been asked to define. 1) Write a public static method named displayArray, that takes two arguments. The first argument is an Array of int and the second argument is a String. The method should print out a list of the values in the array, each separated by the value of the second argument. For example, given the following Array declaration and instantiation: int[] myArray = {1, 22, 333, 400, 5005, 9}; displayArray(myArray, ", ") will print out 1, 22, 333, 400, 5005, 9 displayArray(myArray, ") will print out 1 - 22 - 333 400 - 5005 - 9 2) Write a public static method named getFirst Item, that takes an Array of double as an argument and returns the value of the first element of the array. For example, given the following Array declaration and instantiation: double[] myArray = {1.0, 2.2, 33.3, 40.0, 50.05, 9.0}; getFirst Item(myArray) will return 1.0 3) Write a public static method named getLastItem, that takes an Array of double as an argument and returns the value of the last element of the array. For example, given the following Array declaration and instantiation: double[] myArray = {1.0, 2.2, 33.3, 40.0, 50.05, 9.0}; getLastItem(myArray) will return 9.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
