1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Free_Kalibri [48]
3 years ago
5

Golf scores record the number of strokes used to get the ball in the hole. The expected number of strokes varies from hole to ho

le and is called par (i.e. 3, 4, or 5). Each score's name is based on the actual strokes taken compared to par:
"Eagle": number of strokes is two less than par
"Birdie": number of strokes is one less than par
"Par": number of strokes equals par
"Bogey": number of strokes is one more than par

Given two integers that represent par and the number of strokes used, write a program that prints the appropriate score name. Print "Error" if par is not 3, 4, or 5.

Ex: If the input is:
4
3
Computers and Technology
1 answer:
Kobotan [32]3 years ago
7 0

The program is an illustration of if conditional statement. The programming language is not stated; so, I will answer the question using Python.

The program in Python where comments are used to explain each line is as follows:

<em>#This initializes the scores</em>

scores = ["Eagle","Birdle","Par","Bogey"]

<em>#This gets input for par</em>

par = int(input())

<em>#This gets input for stroke</em>

stroke = int(input())

<em>#This checks if par and stroke are between 3 and 5 (inclusive)</em>

if (par >=3 and par <= 5) or (stroke >=3 and stroke <= 5):

<em>#This calculates the difference between par and stroke</em>

   diff = stroke - par  + 2

<em>#This prints the corresponding score</em>

   print(scores[diff])

<em>#If par or stroke is out of range of 3 and 5</em>

else:

<em>#This prints error</em>

   print("Error")

<em>#At the end of the program, the appropriate score is printed.</em>

See attachment for the program source code and the sample run

Read more about python programs at:

brainly.com/question/16917190

You might be interested in
If a hypothesis is strongly supported by the scientific community based on compelling experiment results, it becomes a————
SOVA2 [1]
I'm pretty sure it becomes a fact.

6 0
2 years ago
Read 2 more answers
Is a protocol that allows users to log on to and access a remote computer?
kompoz [17]
The answer is yes I hope this help ya out

6 0
3 years ago
Czy FALL GUYS będzie działało szybko na i5 GH8? Na ilu FPS?
Lesechka [4]

Answer:español por favor asi te responderé y gracias por los 10 puntos chaoo

Explanation:

6 0
2 years ago
3.6 lesson practice
Thepotemich [5.8K]

what...? how is this a question??

5 0
3 years ago
In the wireless telecommunications industry, different technical standards are found in different parts of the world. A technica
Serhud [2]

Answer:

A varying infrastructure.

Explanation:

The competitive pressure it creates for multinational companies in the industry is one of difference in infrastructure because different technical standards are found in different parts of the world.

For instance, A technical standard known as Global Systems for Mobile (GSM) is common in Europe, and an alternative standard, Code Division Multiple Access (CDMA), is more common in the United States and parts of Asia.

Consequently, equipment designed for GSM will not work on a CDMA network and vice versa as a result of varying infrastructure, so companies would be innovative in order to improve on their products.

3 0
2 years ago
Other questions:
  • What is the definition of framerate?
    7·1 answer
  • Which type of malware can hijack internal windows components and often goes undetected because it is already loaded when the ant
    14·1 answer
  • Naruto Uzumaki who likes naruto ??? who waches it??
    14·2 answers
  • relational integrity constraints are rules that enforce basic and fundamental information-based constraints. True or False
    9·1 answer
  • What is the advantage of maintaining a list of keywords while creating a design blueprint?
    13·2 answers
  • Allows a user to control the<br>volume of the computer​
    8·1 answer
  • Jackie created a poster for a rock band. Which file format will best preserve the graphics? 20PTS​
    14·2 answers
  • The post-closing trial balance shows the balances of only the ____ accounts at the end of the period.
    12·1 answer
  • Which statement best describes what happens when a computer starts?
    9·1 answer
  • A network of computers that provides access to information on the web.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!