Description
Question 2. (ArrayLists.java) Repeat all of the functionality of Question 1 (minus the
bonus) but this time use ArrayLists instead of Arrays. Also, add a prompt to allow the user to
specify a value. Print the number of occurrences of that value in the list. If the value does not
appear, print 0.
Sample output will be posted to D2L.
Question 3. (Arrays2D.java) Write a Java program that will show off 2D arrays. Your program
should use 2D arrays and nested for loops to reproduce the following output. Note: the array is always 4
x 5 and is filled with random numbers between 1 and 10. Only the count occurrences number is collected
from the user. You may do all of this work in a single main() method.
Creating array (4×5, random numbers)
1 9 5 7 6
2 5 2 1 3
4 8 5 1 2
7 9 1 2 6
Sum of array is: 86
Avg of array is: 4.3
Sum of rows is:
0:28
1:13
2:20
3:25
Max of columns is:
0 1 2 3 4
7 9 5 7 6
Count occurrences of: 6
2