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
What is a tax exemption (also known as a tax allowance)?
KengaRu [80]
<span>Tax exemption refers to a monetary exemption which reduces taxable income. Tax exempt status can provide complete relief from taxes, reduced rates, or tax on only a portion of items.</span>
4 0
2 years ago
A buffer storage that improve computer performance by reducing access time is​
kvasek [131]
Cache memory

Hope it helps
4 0
3 years ago
An interrupt priority scheme can be used to ____. allow the most urgent work to be finished first make it possible for high-prio
Nana76 [90]

Answer:

All of the above

Explanation:

An interrupt priority scheme is a system which decides the priority at which various work is done and it perform all of the above mention task so therefore all of the above is the right answer.

5 0
3 years ago
Why is code tracing important when debugging?
larisa [96]

It helps reveal the flow of execution of your program, including results of in-between evaluations. In other words, you can see what your program is doing, and why it takes the decisions it is taking.

If something unexpected happens, the trace will show you the sequence of events that lead to it.

7 0
3 years ago
When somthing is trustworthy we call it what?
Gnom [1K]

Answer:

dependable

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • HELP AS SOON IS A UNIT TEST WILL GIVE BRAINLIEST
    9·2 answers
  • Two different names that refer to the same data item best defines:
    12·1 answer
  • Effective note-taking helps support<br><br> action.<br> distinction.<br> distraction.<br> retention.
    9·2 answers
  • Each object that is created from a class is called a(n) ____________ of the class.
    5·2 answers
  • Does anyone have game design in connections
    13·1 answer
  • Universal Containers is implementing a community of High-Volume Community users. Community users should be able to see records a
    12·1 answer
  • What is thhe name of service included with windows server operating systemthat manages a centralized database containing user ac
    5·1 answer
  • Who created the first photograph
    9·2 answers
  • Which would you trade on a stock exchange? A: Shares B: Bonds C: Annuities
    6·2 answers
  • How can I master networking my home/business computer(s) - Tv's - iot devices and make the whole system as secure as possible?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!