PLEASE TYPE CODE WITH ALIGHMENT AND PROVIDE IN TEXT FORMAT TO
COPY. THANK YOU
(b) Implement the Course class. • There are 3 instance variables: _name (str), _holes (list) and _totalPar (int). • Constructor accepts a filename as parameter and digest the content of the file to initialise/setup the following: o_name: this is the filename without the extension. Hence if filename is given as "abc.txt", the name will be "abc". o holes: create the 18 holes and place them into a List. See Appendix A for the 3 sample files and format of file. _totalPar: represents the par for the course as a whole. This is obtained by adding up the par of each hole. Getter method for the instance variable_name. Use the property decorator. The getPlaySchedule method returns the estimated start and finish time for all 18 holes, given the tee Time (datetime) as parameter. Here is an example in the suggested format: Tee Off Time: 07:08 Course: Pebble Bay Hole PAR Index 1 4 9 2 3 18 3 4 1 4 13 3 11 5 15 4 4 5 5 3 10 5 2 11 4 8 12 4 12 13 4 16 14 3 18 15 4 6 16 4 4 17 3 14 18 5 10 NWU EUWBOU Total PAR: 72 Distance Start 332 07:08 162 07:23 433 07:32 270m 07:50 123m 08:02 470m 08:12 376m 08:28 394m 08:43 556m 09:00 558 09:22 392m 09:44 290 09:59 344m 10:13 150m 10:26 424 10:35 463 10:53 208m 11:11 503 11:21 Finish 07:22 07:31 07:49 08:01 08:11 08:27 08:42 08:59 09:21 09:43 09:58 10:12 10:25 10:34 19:52 11:10 11:20 11:40 mm With exception of hole 1, note the start time of hole n is the next minute of the finish time of hole (n-1).
. NM The strmethod retu returns a string as follows: Course: Augusta Total PAR: 72 Hole PAR Index Distance 1 4 1 435m 5 13 502 5 9 495m 4 4 3 376m 5 4 11 388m 6 3 15 205m 7 4 7 368m 8 4 5 335m 9 3 17 188m 10 4 18 366 11 4 2 405m 12 3 16 183m 13 4 6 392 14 5 12 525m 15 3 8 212m 16 4 14 323m 17 4 10 379 18 5 4 524m Awun ABON bo (12 marks)
PLEASE TYPE CODE WITH ALIGHMENT AND PROVIDE IN TEXT FORMAT TO COPY. THANK YOU
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
PLEASE TYPE CODE WITH ALIGHMENT AND PROVIDE IN TEXT FORMAT TO COPY. THANK YOU
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!