Question
Complete the following program. Be sure to read the problem statement completely. This assignment will be completed in Eclipse on your machine. Design a class
Complete the following program. Be sure to read the problem statement completely. This assignment will be completed in Eclipse on your machine.
Design a class that calculates statistics on data in a file. We expect the file to contain grades represented by integer values, one per line. If you encounter a value that is not an integer, you should throw an exception, print a message to the console, skip that value, and continue processing. Store the grades that you read in an ArrayList so that all grades are available for retrieval. You should also have, at a minimum, methods that return the average grade, the highest grade, the lowest grade, and one that returns all the grades as an array of letter grades. The constructor should accept the name of the data (input) file.
Test this class with an application that creates two objects sending two different text files as the data file. Create these text files. One that contains all integers and will not throw an exception and one that contains some values that will throw an exception. Make sure the test application calls each method for each object displaying the highest, lowest, and average grades, as well as the list of letter grades.
You may add other functionality you consider relevant but be sure to include what is listed above at a minimum.
Be sure to test your program. Make sure your program is properly documented using comments where needed. Note that this project must be done individually.
You may write to the console window. Make sure your input and output are formatted nicely and easy to read.
You are to submit your GradeCalc.java and the test application .java file in by the due date.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started