A Customer class is being developed for a small business. The suggested code for this class is
Question:
A Customer class is being developed for a small business. The suggested code for this class is shown below:
The owner of the business requires that the customer ID must comprise a single letter followed by exactly 3 numbers.
(a) Create a CheckableCustomer class that inherits from the Customer class and implements the Checkable interface that we developed in Sect. 13.3. The class will override the check method according to the above rule.
(b) Adapt the Checker program from Sect. 13.3 so that it now checks the validity of a CheckableCustomer object, according to the above rule.
(c) Adapt the InnerClassDemo program from Sect. 13.4 so that CheckableCustomer is now specified as an inner class.
(d) Adapt the AnonymousClassDemoVersion1 and AnonymousClassDemoVersion2 programs from Sect. 13.5 so that an anonymous class is used instead of an inner class to check the validity of a Customer Object.
(e) Finally, adapt program LambdaDemo program from Sect. 13.6 to use a lambda expression to check the validity of a Customer object.