Question: programming language to use java please create all of the...
Programming language to use: Java. Please create all of the classes, exceptions, or etc that is needed.
Write a simple driver/client/main class with 2 methods. You may add this code to the Driver class from problem #1.
The main() method should:
- Call a method called fileAverage()
- If the method generates an exception, print out the message generated by the Exception
The fileAverage() method should:
- Read in the data from a file called: numbers.txt The numbers from the file should be stored into your choice of an array or ArrayList... A sample version of this file has been provided, but the one being tested with may have between 1 and 10000 numbers.
- If the array or ArrayList contains only 1 element (because the file only contained one element), throw an InsufficientDataException with the message "Exception: Not enough data in the file!"
- Calculate the average (mean) of the numbers in your array or ArrayList (must have a separate loop that goes through the array or ArrayList to sum the values in the array or ArrayList to receive full credit)
- Print the average calculated by the code along with the EXACT
correct message from below:
- If the average is greater than 100, print "The average is large"
- If the average is less than 100, print "The average is small"
- If the average is exactly 100, print "The average is exactly 100"
- 10 -- Correctly and completely reading from the file and storing it into your array or ArrayList
- 5 -- Correctly and completely using a loop to calculate the average (mean) of the numbers in your array or ArrayList
- 5 -- Correctly and completely providing the required output of the program
- 10 -- Correctly creating the Exception class
- 10 -- Correctly generating/throwing the Exception