In Java Develop a function to create arrays of random integers. The caller sends the desired size of the array and the minimum and maximum values to generate for the array. The function returns the specified array. For example, with arguments of 10, 1 and 100, the function returns an array of 10 random integers from 1 to 100. With arguments of 5, -10 and 10, the function returns an array of 5 random integers between -10 and 10. Develop two functions: one to display arrays of integers and another to display arrays of Strings. In both functions, display the length of the array, then display the array index followed by the array value at that index. Two examples are below: a. Given the integer array {2, 30, 9, 48, 5, 72, 3}, the function displays: Array has 7 elements [0]: 2 [1]: 30 [2]: 9 [3]: 48 [4]: 5 [5]: 72 [6]: 3
In Java
Develop a function to create arrays of random integers. The caller sends the desired size of the array and the minimum and maximum values to generate for the array. The function returns the specified array. For example, with arguments of 10, 1 and 100, the function returns an array of 10 random integers from 1 to 100. With arguments of 5, -10 and 10, the function returns an array of 5 random integers between -10 and 10.
Develop two functions: one to display arrays of integers and another to display arrays of Strings. In both functions, display the length of the array, then display the array index followed by the array value at that index. Two examples are below:
a. Given the integer array {2, 30, 9, 48, 5, 72, 3}, the function displays:
Array has 7 elements
[0]: 2
[1]: 30
[2]: 9
[3]: 48
[4]: 5
[5]: 72
[6]: 3
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images