Question: Add a main so that you can put some code there to call your functions and make sure they work: public static void main(String[] args)
Add a main so that you can put some code there to call your functions and make sure they work:
public static void main(String[] args) { /* your testing code goes here */ }
Functions you should add if the functionality is possible. Otherwise add an empty function definition with a comment saying "impossible".
public static int[] getEveryOther(int[] values) {
/* This function should return a new array that contains every other value contained in the values array. In other words, the function should return a new array containing the values from positions 0, 2, 4, 6. and input array values should remain unchanged. */
}
** Test input: same as #1
public static HashMap
/* fullNames is an array of entries all in the format "FirstName LastName", a first name and a last name separated by a space. This function should return a map where the keys are the LastNames from the input array and the corresponding value is the associated FirstName. You may assume each LastName only occurs once in the input array. */
}
** Test input: an empty array; an array containing "Barry White" and "Bob Marley"
public static HashMap
/* fullNames is an array of entries all in the format "FirstName LastName", a first name and a last name separated by a space. This function should return a map where the keys are the LastNames from the input array and the corresponding value is a list of all the FirstNames that appeared with that LastName in the input array. */
}
** Test input: an empty array; an array containing "Barry White" and "Bob Marley"; an array containing "Barry White", "Bob Marley", and "Betty White".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
