Question: Please I need help! in Java Method name: deleteArray Parameter(s): An int array. Return value: Nothing. The method return type is void. Post-Condition: The array
Please I need help! in Java
- Method name: deleteArray Parameter(s): An int array. Return value: Nothing. The method return type is void. Post-Condition: The array parameter has every element in the array set to 0. Example: After calling clearArray([1, 2]), the array has its elements changed to [0,0]. I want you to use a loop to set the elements, not any fill methods. The point of this method is to see that the array can be changed in the void method.
- Method name: arrayToString Parameter(s): An int array. Return value: A String containing a textual representation of the parameter. The return String should start with a curly brace, then have all the numbers in the array with a comma and space between numbers, and then ending with an end curly brace. Arrays.toString or its variants should not be used in this method. Post-Condition: The array parameter is not changed. Example: Calling arrayToString([1, 2]) should return "{1, 2}".
- Method name: getsDuplicate Parameter(s): A String array. Return value: Returns boolean true if one element of the array is equal() to another element of the array and false otherwise. Post-Condition: The array parameter is not changed. Example: Calling containsDuplicate(["David", "Joe"]) should return false. Calling containsDuplicate(["a", "b", "a"]) should return true.
- Method name: averageArrayValues Parameter(s): An int array of at least length 1. Return value: Returns a double value that is the sum of the array elements divided by the array length. The requirement of at least one value is to prevent a divide by zero possibility. Post-Condition: The array parameter is not changed. Example: Calling averageArrayValues([1,2]) should return 1.5.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
