PLEASE POST CODE WITH PROPER ALIGNMENT AND IN TEXT FORMAT TO
COPY. THANK YOU Answer both part C and D
(c) Implement a subclass, GolfingException of the Exception class. This class has no additional attribute or method. When the application encounters a golfing rule violation, an exception from this class is raised. (1 mark) (d) Implement the Flight class. The Flight class has: One instance variable:_golfers (list) represent the flight of golfers. Constructor accepts a list of golfers and assign to the instance variable golfers. The constructor must validate that (1) the number of golfers to be minimum 3 and maximum 4, (2) that the membership status for the flight of golfers is active. Otherwise, raise GolfingException with appropriate messages stating that a flight can only consists of 3 or 4 golfers, or indicate which golfer has inactive membership Using the parameter memberID, the searchGolfer method searches and returns the Golfer object if there is a golfer in the flight with the matching memberID. If not found, it returns None. : The getGolfersID method returns the flight's golfers' memberID in a List. Method getWeekend Eligibility return a Boolean value indicating if this flight of golfers can book a golf session on weekend. To book a weekend tee slot/time, all golfers of the flight must have “Full” memberships and their membership status should be "active". (6 marks)
PLEASE POST CODE WITH PROPER ALIGNMENT AND IN TEXT FORMAT TO COPY. THANK YOU Answer both part C and D
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
PLEASE POST CODE WITH PROPER ALIGNMENT AND IN TEXT FORMAT TO COPY. THANK YOU Answer both part C and D
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!