1. Write a method that converts all Strings in an array to upper case. The metho
ID: 3665814 • Letter: 1
Question
1. Write a method that converts all Strings in an array to upper case. The method header is:
public void convertToUpper(String[] words)
2. Write a method to create a new array that contains only the elements between specified indices (inclusive). The method header is:
public int[] subArray(int[] numbers, int start, int end)
For example, if the method was invoked with {1, 5, 2, 4, 7, 3}, start = 1, end = 4, the method would return {5, 2, 4, 7}.
Include appropriate error checking for the indices.
3. Write two methods that double array elements. The first doubles the elements in the array passed in as a parameter. The second creates a new array that contains double the elements of the array passed in as a parameter. In the second method, the array passed in as a parameter should not change. The method headers are:
public void doubleElementsInArray(int[] numbers)
public int[] createDoubleElementsArray(int[] numbers)
Explanation / Answer
1.Write a method that converts all Strings in an array to upper case. The method header is:
public void convertToUpper(String[] words)
2.Write a method to create a new array that contains only the elements between specified indices .
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.