In python please*** in golf, par represents a standard number of strokes a player needs to complete a hole. instead of using an absolute score, players can compare their score on a hole to the par figure. families can play nine holes of miniature golf at the family miniature gold park. so that family members can compete fairly, the course provides a different par for each hole based on the player's age. the par figures are shown below:
1. develope the logic for a program that accepts the players name, age, and nine hole scores as input. display the players name and score on each of the nine holes, with one of the phrases "over par", "par", or "under par" next to the score.
2. modify the program so that at the end of the golfer's report, the total score is displayed. include the player's score in relation to par for the entire course.
## Uncomment the code below to get solution for 2nd part
groups={4:[8, 8, 9, 7, 5, 7, 8, 5, 8],5:[7, 7, 8, 6, 5, 6, 7, 5,
6],8:[6, 5, 6, 5, 4, 5, 5, 4, 5],
12:[5, 4, 4, 4, 3, 4, 3, 3, 4],16:[4, 3, 3, 3, 2, 3, 2, 3,
3]}
print(groups[4][3])
n=int(input("Enter No.of players"))
player_list=[]
scores={}
for i in range(n):
player_list.append([input("name"),int(input("age"))])
for i in player_list:
lst=[]
for j in range(9):
print("Score for hole ",j+1)
lst.append(int(input("")))
scores[i[0]]=lst
for i in player_list:
index=0
## totalscore=0
## partotalscore=0
print("Player name:",i[0])
if(i[1]<=4):
index=4
elif(i[1]<=7):
index=5
elif(i[1]<=11):
index=8
elif(i[1]<=15):
index=12
else:
index=16
for j in range(9):
## totalscore=totalscore+scores[i[0]][j]
## partotalscore=partotalscore+groups[index][j]
if scores[i[0]][j] >= groups[index][j]:
if scores[i[0]][j] == groups[index][j]:
msg = " Par"
else:
msg = " Over par"
else:
msg = " Under par"
print("Hole",j+1," ",scores[i[0]][j],msg)
## if totalscore >= partotalscore:
## if totalscore == partotalscore:
## msg =" Par"
## else:
## msg = " Over par"
## else:
## msg = " Under par"
## print("Total Score ",totalscore,msg)
In python please*** in golf, par represents a standard number of strokes a player needs to...
7. On an 18-hole golf course, the 18 holes are made up of par-3 holes, par-4 holes, There are twice as many gol and par-5 holes. A golfer who shoots par on every hole has a score of 70. par-4 holes as there are par-5 holes. Note, in the game of , If a hole has a par-3 and you shoot par this means you took three shots to get the golf ball in the hole. How many of each...
Birdie Bogey Double Bogey Par Strokes Round 2 3 364 198 654 391 94 62 1,653 824 346 731 113 1,604 196 396 53 832 The accompanying table summarizes the performance of golfers in a tournament. The table shows the number of holes in each round completed in fewer than the allowed number of strokes (birdies), at the allowed number of strokes (par), with one extra stroke (bogey), or with two extra (double bogey). Only players who score among the...
The the results or the golf tournament played at the end of March. The Club president Mr. Martin has asked you to write two programs. Country Club has asked you to write a program to gather, then display The first program will input each player's first name, last name, handicap and golf score and then save these records in a file named golf.txt (each record will have field for the first name, last name, handicap and golf score). The second...
Please help as it is very important task for me please write in Python code and divide this into function and write comments for it 1. Ask the player’s name and welcome them to the game using their name. 2. Ask the player what is par for this game (number between 3-5 inclusive) 3. Ask the player what the distance to the hole for this game is (whole number between 195 and 250 inclusive) 4. Show the game menu: (I)nstructions...
please answer question b) payong careful attention to the
notation.
Simon plays golf at his local 18-hole golf course. In his last 20 visits, he works out that he has scored above par on 60% of the holes he has played. For each visit, he models the number 3 es where he scores above par, H, using a binomial distribution: H- B(18, 0.6). Give one assumption that Simon has made in modelling H in this way. a) b) Each time...
9.72 G olf Scores In a professional golf tournament (c) Find a 95% interval to predict the average final e players participate in four rounds of golf and the player with the lowest score after all four rounds is th score of all golfers who shoot a +3 in the first round at the Masters. e champion. How well does a player's performance in the first round of the tournament predict the final score? Table 9.6 shows the first round...
(C++) Write a program that declares a struct to store the data of a football player (player’s name, player’s position, number of touchdowns, number of catches, number of passing yards, number of receiving yards, and the number of rushing yards). Declare an array of 10 components to store the data of 10 football players. Your program must contain a function to input data and a function to output data. Add functions to search the array to find the index of...
Assignment 2 – The two player game of Poaka The game of Poaka is a dice game played by two players. Each player takes turns at rolling the dice. At each turn, the player repeatedly rolls a dice until either the player rolls a 1 (in which case the player scores 0 for their turn) or the player chooses to end their turn (in which case the player scores the total of all their dice rolls). At any time during...
This program will ask the user to enter a number of players, then ask the user for each player's name and score. Once all of the players have been entered, the program will display a bar chart with each of their scores scaled as a percentage of the maximum score entered. See below for details on exactly how this should work - an example transcript of how the program should work is shown below (remember that values entered by the...
Chapter 8
Python Case study Baseball Team Manager
For this case study,
you’ll use the programming skills that you learn in Murach’s
Python Programming to develop a program that helps a
person manage a baseball team. This program stores the data for
each player on the team, and it also lets the manager set a
starting lineup for each game. After you read chapter 2, you can
develop a simple program that calculates the batting average for a
player. Then,...