Programming Principles CSP1150D: Golf Club Program Assignment Solution

Verified

Added on  2022/11/03

|4
|502
|447
Homework Assignment
AI Summary
This document presents a solution for the "Golf Club" program assignment, designed to test understanding of programming principles including variables, data types, selection, iteration, functions and data structures. The program, written in Python, implements a menu-driven system allowing users to enter, display, and search for golf player details and scores. The solution uses lists to store player information, incorporating functions for data input, display, and search operations. The program's algorithm involves prompting the user for options, handling player data entry, searching for specific players, and displaying scoreboards, culminating in a functional solution demonstrating proficiency in Python programming and data structure implementation. The document includes pseudocode and a detailed description of the code's logic and functionality, alongside references to relevant literature on data structures and Python programming.
Document Page
Running head: CSP1150D PROGRAMMING PRINCIPLES
CSP1150D Programming Principles
Name of the Student
Name of the University
Authors note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
2CSP1150D PROGRAMMING PRINCIPLES
For this program, the main criteria was to develop a program that will store name, and
their scores of the golf players in some data structure in python language. The program is
started by declaring a list all_players[] as a global that contains zero elements. Then the
project is prints a welcome statement to the user. After this the user will be asked to select the
operation they want to proceed with. There are four options which are enter player details,
display the player details, search player and finally exit from the program. The menu driven
program is presented to the user using a while loop that keeps asking for user options until
users chooses the exit options. The data is stored using lists, list acts as container available in
python inbuilt data structure that is helpful in storing different types of data at the same time.
Compared to the Set data structure, list data structure in Python is considered as ordered and
have a definite size.
There are functions declared in the program that asks details of the players and their
scores. At first the number of players whose details will be saved through the program is
asked and user will enter the number of the players as integer. The score of player is taken as
input (in the form of integer) when the user enters the values of the name and score to the list.
Following is the algorithm for the implemented project;
Step1: Prompt option for the user
Step 2: if Option =1
Step 3: Enter the number of players
Step 4: Enter the name and score of the players.
Step 5: Go to menu prompt
Step 6: if option =2
Step 7: Search for a Player
Document Page
3CSP1150D PROGRAMMING PRINCIPLES
Step 8: enter name of the player
Step 9: If found Display the player details
Step 10: If Option==3
Step 11: Display details of the players.
Step 12: If option ==4
Exit ();
Document Page
4CSP1150D PROGRAMMING PRINCIPLES
References
Kapil, S. (2019). Data Structures. In Clean Python (pp. 49-75). Apress, Berkeley, CA.
Lee, K. D., & Hubbard, S. (2015). Data structures and algorithms with Python. Springer.
Payne, J. R. (2019). Introducing Other Data Structures. In Python for Teenagers (pp. 173-
198). Apress, Berkeley, CA.
Smelter, A., & Moseley, H. N. (2018). A Python library for FAIRer access and deposition to
the Metabolomics Workbench Data Repository. Metabolomics, 14(5), 64.
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]