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
Please someone help!!!!
Montano1993 [528]

Answer:

do what the directions say and you should be able to figure out the answer if not contact me through brainly

Explanation:

3 0
3 years ago
Which of the constraints listed below would be considered a physical constraint
timurjin [86]
Materials

materials are the only physical thing
8 0
2 years ago
Multibeam sonar technology uses _____.
blsea [12.9K]
More than one sound source and listening device<span>
</span>
8 0
3 years ago
Read 2 more answers
This is a random question, it’s not about computers or technology
ivann1987 [24]

Answer:

Explanation:

There’s only an AngelKittenn583

To delete in an account ,you must sign into it with the email and password, go into your setttings, and find the “Delete Account” Button

4 0
3 years ago
Personal letterheads are created in the Footer of a document.
Alex_Xolod [135]
The answer is false .

The letterhead is organized with appropriate information on the top and bottom of the letter with most of the space left to enter the letter contents.

hope this helps.
6 0
3 years ago
Other questions:
  • ACCOUNTING
    13·2 answers
  • If a surface is. it is exactly vertical
    11·1 answer
  • To erase a character to the right of the insertion point, press the ____ key(s).
    15·1 answer
  • Which of the following is NOT part of the URL for an Internet web site?
    13·1 answer
  • What happens when i expose a disk to magnetic fields?​
    5·1 answer
  • Which of the following technologies is an example of social media
    12·1 answer
  • The operating systems, and utility programs that perform system
    6·1 answer
  • 8.6 Code Practice: Question 2
    7·1 answer
  • What name is given to any changes to the original data such as users manually modifying data, programs processing and changing d
    15·1 answer
  • How do I find unwanted programs on my computer?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!