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 an ______ is caught dumping hazardous materials, that person can be prosecuted. Answer choices A) Employee B) Employer C) Bot
Citrus2011 [14]

Answer:

Both A and B

Explanation:

I think it is right

hope this helps :)

5 0
2 years ago
: how can you reduce file size so that files can be sent more efficiently across the internet
Rina8888 [55]
You can compress them. ZIP is the most well known protocol.
8 0
3 years ago
What number system do people in America use?
Sindrei [870]

Answer:

Base-10 (decimal)

Explanation:

8 0
3 years ago
Read 2 more answers
What is a tag in an HTML document?
Llana [10]

Answer: HTML is considered as the Lingua franca of the net that is a simple mark up language used for the purpose of web publishing for creating text and images. This can be viewed by any of the member and can be used within any browser. There is no need of special software for creating HTML pages and moreover the learning of HTML is pretty easy.

Explanation: If you need more help go follow me at dr.darrien

- thank you

3 0
3 years ago
Read 2 more answers
To format a picture to look like a sketch or a painting you can add a(an)
Arisa [49]

Answer:

C(reflection effect)

Explanation:

reflection effect

8 0
3 years ago
Other questions:
  • Which company provides the Loki Wi-Fi mapping service?
    10·1 answer
  • Question 1 (1 point)
    10·2 answers
  • PLZ HELP ME! What is a false statement about online time?
    9·1 answer
  • What is the financial aspect for a business as to what database software they will buy?
    6·1 answer
  • Given a variable temps that refers to a list, all of whose elements refer to values of type float, representing temperature data
    10·2 answers
  • What is a directed graph?
    5·1 answer
  • Remote wiping is a device security control that allows an organization to remotely erase data or email in the event of loss or t
    10·2 answers
  • The stub: transmits the message to the server where the server side stub receives the message and invokes procedure on the serve
    8·1 answer
  • Write an application that determines whether the first two files are located in the same folder as the third one. The program sh
    6·1 answer
  • CSNET Stand for in a computer
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!