in java Select a signature for each method described below. Do not write the met
ID: 3864375 • Letter: I
Question
in java
Select a signature for each method described below. Do not write the methods!
a) The method finds the number of times a given value occurs in a given array of integers.
b) The method finds the largest value stored in an array of integers in the subrange between from (inclusive) and to (exclusive)
c) The method reverses the elements in an array of Strings, and stores the results in a newly constructed array.
d) The method reverses the elements in an existing array.
e) The method creates an array of doubles of a given size with randomly generated elements between 0 (inclusive) and 1 (exclusive).
Explanation / Answer
a) The method finds the number of times a given value occurs in a given array of integers.
Answer: public int getNumberCount(int array[], int searchValue) {}
b) The method finds the largest value stored in an array of integers in the subrange between from (inclusive) and to (exclusive)
Answer: public int getMaxValue(int array[], int a, int b){}
c) The method reverses the elements in an array of Strings, and stores the results in a newly constructed array.
Answer: public String[] reverseStringArray(String array[]){}
d) The method reverses the elements in an existing array.
Answer: public void reverseArray(String array[]){}
e) The method creates an array of doubles of a given size with randomly generated elements between 0 (inclusive) and 1 (exclusive).
Answer: public void createArray(int size, int a, int b){}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.