Question 2 (30 marks) Golfers who want to play a game will need to form a Flight. A Flight is made up of minimum 3 golfe

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Question 2 (30 marks) Golfers who want to play a game will need to form a Flight. A Flight is made up of minimum 3 golfe

Post by answerhappygod »

Question 2 30 Marks Golfers Who Want To Play A Game Will Need To Form A Flight A Flight Is Made Up Of Minimum 3 Golfe 1
Question 2 30 Marks Golfers Who Want To Play A Game Will Need To Form A Flight A Flight Is Made Up Of Minimum 3 Golfe 1 (87.47 KiB) Viewed 18 times
Question 2 30 Marks Golfers Who Want To Play A Game Will Need To Form A Flight A Flight Is Made Up Of Minimum 3 Golfe 2
Question 2 30 Marks Golfers Who Want To Play A Game Will Need To Form A Flight A Flight Is Made Up Of Minimum 3 Golfe 2 (70.4 KiB) Viewed 18 times
Question 2 (30 marks) Golfers who want to play a game will need to form a Flight. A Flight is made up of minimum 3 golfers and maximum 4 golfers. There are 2 types of golfers: Handicapped Golfers: These are skilled golfers with a handicap number that represents the golfer's ability. Golf handicap is generally between 0 and 36. The lower the handicap number, the better the player. PC Holders: Proficiency Certificate (PC) is normally issued by a golf club to allow a new golfer to play in order to gain sufficient experience, prior to their Handicap Test. Hence, there is an expiry date for the Proficiency Certificate. For PC Holders, their golf handicap is 99.9 Refer to the class diagram in Figure 3. Golfer (abstract) Flight NEXT ID: int #1 _golfers: List memberid:int _init__(self, golfers: List) searchGolfer(self, memberiD:int): Golfer membership: str getGolfersin(self): List _status: bool getWeekend Eligibility(self): bool _init__(self, name: str, membership: str) memberi(self): int name(self): str membership(self): str membership(self, newValue: str) getMembershipStatus(self): bool setMembershipStatus(self, newValue: bool) GolfingException getHandicap(self): int {abstract] _str_(self): str name: str 3..4 PC Holder expiry Date: datetime HandicappedGolfer handicap: float _init_(self, name: str, membership: str, handicap: float) getHandicap(self): float _str_(self): str _init__(self, name: str, membership: str, expiry Date: datetime) getMembershipStatus(self): bool renew(self, newExpiryDate: datetime) getHandicap(self): float _str_(self): str Figure 3 (a) Implement the Golfer class. The Golfer class has: • It has a class variable: _NEXT_ID, starting from 1, used for generating running numbers to uniquely identify the golfers. There are 4 instance variables: memberID (int): a unique member number for this golfer. .
o name (str): the name of this golfer. membership (str): either "Full" or "Basic" membership. Full membership can enjoy golfing at any time of the week, while Basic members are allowed to golf on weekdays only. status (bool): this is the membership status, either True or False to represent active and inactive respectively. Constructor initialises these 2 variables: _name and _membership. It will also generate a unique member ID for this golfer. The_memberID is generated using the class variable_NEXT_ID and_status is defaulted to True. Getter methods for the 3 instance variables: _memberID, name and membership. Use the property decorator. Setter method for_membership. Use the setter decorator. The method getMembershipStatus returns the value of _status (Boolean). setMembershipStatus method accepts a Boolean value as parameter and assign it to _status. One abstract method, getHandicap which returns the handicap number for this golfer. The_str_method returns a string representation of a Golfer object, which should include the memberID, name, membership, and status. Here are 2 examples in the suggested format. Example 1: golfer with Full membership and status “Active" Member ID: 1 Name: Tommy Woods Membership: Full(A) Example 2: golfer with Basic membership and status "Inactive" Member ID: 5 Name: Phil Stenson Membership: Basic(I) (7 marks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply