public static void main(String[] args) {
        int arrayLength = 10; // length of arrays for this exercise
        int maxNumber = 20; // upper bound of random number
        int minNumber = 1; // lower bound of random number
        int numberToSearchFor; // number to be entered by user to search for
        int[] arrayCopy; // copy of the unsorted array
        int[] unsortedArray; // array to hold unsorted random numbers
        Scanner scanner; // scanner for receiving user input

        // initialize the array with random numbers
        unsortedArray = new int[arrayLength];
        for (int i = 0; i < unsortedArray.length; i++) {
            unsortedArray[i] = (int) (Math.random() * maxNumber + minNumber);
        }

        // copy unsorted array
        arrayCopy = Arrays.copyOf(unsortedArray, unsortedArray.length);
        // sort the array
        Arrays.sort(arrayCopy);

        // print formatted table of sorted and unsorted arrays
        System.out.println("Unsorted Array      Sorted Array");
        for (int i = 0; i < arrayLength; i++) {
            System.out.printf("%1$-20d%2$-20d%n", unsortedArray[i], arrayCopy[i]);
        }

        // prompt for a number to search for
        scanner = new Scanner(System.in);
        System.out.print("Please enter number to search for: ");
        numberToSearchFor = scanner.nextInt();

        // search each array and output results
        searchArray(unsortedArray, numberToSearchFor, "unsorted array");
        searchArray(arrayCopy, numberToSearchFor, "sorted array");
    }