Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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) aboveStep 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