educational course/tutorialoutlet.com educational course/tutorialoutlet.com | Page 60

thrown ArrayIndexOutOfBoundsException exceptions. Display the message passed back via the throw. Also display a message that no more data will be read from the file. Set a value to exit the loop( so no more data will be read). Loop until there is no more file data or an exception is thrown. o Close file. Display the number of SpeedingTicket objects stored in the ticket data array. Catch any FileNotFoundException exceptions. When caught: Display a message that explains which file could not be opened. o Return the count of tickets stored in the array Define a method to calculate and store values in the fines array. The method will: o Have one parameter, the empty fines array o Define constants for all fixed values in the calculations( from page 1 of this assignment). o For each ticket stored in the ticket array: Access the clockedSpeed and speedLimit data stored in the object using getters. Calculate the ticket fine. Store the calculated fine in the fines array. Define an instance method to produce a fines report. The method will create an output file with the fines report. The method should: o Have one parameter, the fines array o Read the filename for the report output file from the user. o Try to open the report output file If the file opened successfully, generate a report and write it to the output file. The output file will contain a list of vehicle license plate numbers( accessed via a getter) and the fine associated with that license, with the fines rightaligned on the decimal point. The last line of the output file will contain the total of all fines collected, rightaligned on the decimal point, with the fines listed above it. Sample output file BBB222