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

variable. It will not create the array object. Unauthorized distribution( including uploading to any non-Regis Internet website) violates copyright law Within the TicketArraysImpl class: Define a constructor that will: o Instantiate a ticket array object( using new to initialize the array reference variable and the constant array size) o Initialize the count of tickets stored to 0 Define an instance method to add one SpeedingTicket object to the ticket data array. The method will: o Have one parameter, the ticket object to add o Test to see if the array is full If the array is full, will throw an ArrayIndexOutOfBoundsException Include a message to pass to the exception handler that states the array is full and stating which license cannot be added. Otherwise, store the ticket object into the array and increase the ticket count Define a method to read all the data from the input file and store the ticket data by adding SpeedingTicket objects into the array. The method will: o Have one parameter: the name of the data input file( String) o Return an int value If the file was opened successfully, the method will return the number of tickets stored in the array. Otherwise, it will return 0, to indicate the file could not be opened / read. o Implement code to try to open the input data file. If the file opened: Display a message that the program is reading the file data In a loop: Read the three data items from one line of data in the input data file Call the constructor to create a new SpeedingTicket object. Try to call the instance method to add the ticket object to the ticket data array( this is an instance method of the TicketArrayImpl class) Catch any