Question: A program that generates random numbers that are between 1 and 100, then searches for the values. /**************************************************************************************************************************** Declare an array list to hold random
A program that generates random numbers that are between 1 and 100, then searches for the values.
/****************************************************************************************************************************
Declare an array list to hold random numbers. ? Get input for how many random numbers to use. ? Using a for loop, add random numbers to the array list between 1 and 100. ? Get input for value to be searched. ? Using a for-each loop and a sequential search, search through the array list for the search term entered. 90% o Output Unsorted list and: o For each match found, output # found at location: # (see example) ? Use java collections to sort the array list. ? Using a for-each loop and a sequential search, search through the array list for the search term entered. o Output Sorted list and: o For each match found, output # found at location: # (see example) ? Only print the headers and values if the search item is found. Print the total value of all random numbers added together after the search has complete.
***********************************************************************************************************************/
Output sample


/******************************************************************************************
The code I came up with is below but is majorly flawed am sure that it is not right and running into plenty errors along the way.
import java.util.Scanner; import java.util.Random; import java.util.ArrayList;
public class ArrayListWork { public static void main(String[] args) { Scanner scan = new Scanner(System.in); Random rand = new Random(); ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
