Look back at the time table application that you developed in programming Exercise 8 of Chap. 8. Here is a reminder of the original design for the TimeTable class: As you can see several methods...

Look back at the time table application that you developed in programming Exercise 8 of Chap. 8. Here is a reminder of the original design for the TimeTable class: As you can see several methods return boolean values. Some of these boolean values were sent to indicate errors. Now modify this class to make use of exceptions as follows: (a) Develop a TimeTableException class (make this an unchecked exception). (b) Modify the TimeTable class so that the constructor, and the methods makeBooking, and cancelBooking all throw a TimeTableException if an error occurs (this would mean that the methods makeBooking and cancelBooking no longer need to return boolean values). (c) The getBooking method currently returns null if either the given day or period number passed as parameters are invalid. Re-write this method to return an Optional value instead. (d) Modify the tester that you developed for the time table application to take account of the exceptions and Optional value you incorporated in parts (b) and (c) above.
Nov 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here