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
When you have to make a long-distance call, dialing an unfamiliar area code plus a seven-digit number, you are likely to have tr
Mashutka [201]

Answer:

c. short-term

Explanation:

According to a different source, these are the options that come with this question:

a. long-term

b. implicit

c. short-term

d. explicit

This best illustrates the limited capacity of short-term memory. Short-term memory is the most recent information that a person holds in his head. Usually, this corresponds to events that occurred in the last 30 seconds to the last few days. This type of memory stores recent events, as well as sensory data such as sounds.

3 0
3 years ago
Mason is planning to use the Horizontal Type Mask Tool for some text editing in a project. Which icon will he select from the Te
SCORPION-xisa [38]
The answer is T
Explanation: I just took the test :)
6 0
3 years ago
Why must web designers select a common font?
Mnenie [13.5K]

Web designers select a common font To make the page easier to read

<u>Explanation:</u>

The taste and preferences of one person differs greatly with that of the other person. Some person likes one type of font in web design that appeals his eyes whereas it may be irritating to others. While designing a web page some of the important things must be taken into consideration in which the font type that you use is an important thing. .

Web pages usually have limited font types that you can use with. A wed design that is designed greatly with pleasing layouts and designs, visual cues, variations in order to ease the readers gains more visitors. The reason for which the web designers commonly select a standard font is to provide readers an easier way to read the website's contents.

3 0
4 years ago
Read 2 more answers
Please help <br>if I clear data on play services framework, will it delete all files on phone​
asambeis [7]

Answer:

Hey there!

Explanation:

Hope this helps :)

5 0
3 years ago
Suppose you want to view a document that has several heading with you would you use
Airida [17]
Microsoft word it has a multiple headings option
5 0
4 years ago
Other questions:
  • Is there anyone willing to sign into my google classroom account and help with my work :( i had surgery on monday and have about
    14·2 answers
  • What is the purpose of copyfitting?
    12·1 answer
  • A ________ is a computer or other electronic device connected to a network
    6·1 answer
  • To use the styles in an external style sheet, you can drag and drop the style sheet file into the head section of the aspx file
    14·1 answer
  • How do you answer a question on this app?!? Do you comment on the question? I need a reminder! (I haven't been on this app in a
    12·1 answer
  • Write a program that:
    13·1 answer
  • Make this the most answered question<br><br><br><br> (for tiktok)
    8·2 answers
  • _____ is an instruction for a computer to perform a specific task.
    14·1 answer
  • Toby wants to gain experience in child development. Toby chooses to enter a month-long certificate program after high school and
    15·1 answer
  • What is the destination ip address when an ipv4 host sends a dhcpdiscover message?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!