Question: Java program Thank you As you can see several methods return boolean values. Some of these boolean values were sent to indicate errors. Now modify

Java program

Java program Thank you As you can see several methods return boolean

Thank you

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!