Use a 1-D array to solve the following problem: Write an application that asks the user to input five numbers, each between 10 and 100 (inclusive). As each number is read, display it only if it is not a duplicate of a number already read. Provide for the "worst case in which all five numbers are different. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user inputs each new value.
Re-write the program above, this time using a collection class derived from Set (e.g. HashSet). As you will have discovered in yourResearch, sets handle duplicates differently from arrays, so your program's algorithm may be quite different using a set.
Write a Java program to read and process a text file. The name of the text file is entered by the user. If the file does not exist, the program displays an error message and exits. Otherwise, the file is opened and read, keeping a count of the number of lines and total number of characters. These two values are displayed in a message box after the whole file has been read. After use, the file is closed. (Note that words are simply considered to be any text that is separated by spaces.)