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
Write a generator function named count_seq that doesn't take any parameters and generates a sequence that starts like this: 2, 1
-BARSIC- [3]

Answer:

#required generator function

def count_seq():

   #starting with number 2. using string instead of integers for easy manipulation

   n='2'

   #looping indefinitely

   while True:

       #yielding the integer value of current n

       yield int(n)

       #initializing an empty string

       next_value=''

       #looping until n is an empty string

       while len(n)>0:

           #extracting first digit (as char)

           first=n[0]

           #consecutive count of this digit

           count=0

           #looping as long as n is non empty and first digit of n is same as first

           while len(n)>0 and n[0]==first:

               #incrementing count

               count+=1

               #removing first digit from n

               n=n[1:]

           #now appending count and first digit to next_value

           next_value+='{}{}'.format(count,first)

       #replacing n with next_value

       n=next_value

#testing, remove if you don't need this

if __name__ == '__main__':

   #creating a generator from count_seq()

   gen=count_seq()

   #looping for 10 times, printing next value

   for i in range(10):

       print(next(gen))

Explanation:

6 0
3 years ago
Andy wants to install a new Internet connection. He wants to take the fastest he can get. What are the maximum speeds for the fo
aksik [14]

Answer:

1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server. so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.

5 0
2 years ago
Can I have help on this
never [62]

the answer is the seconf one


6 0
3 years ago
Read 2 more answers
Create an absolute value component abs() with an 8-bit input A that is a signed binary number, and an 8-bit output Q that is uns
Stolb23 [73]

Answer:

Explanation:

Find attached the solution

5 0
3 years ago
Gabe wants to move text from one document to another document he should __
musickatia [10]

The best way to move text from one document to another is to copy it to the clipboard on the computer and then paste it on the new document.

In order to move the text, Gabe will need to select (highlight) the text that he wants to copy and then copy it. He can copy it by clicking on the copy icon or right click and choose copy. This step places the text on the clipboard. The next step is to place the cursor in the new document and then click the paste icon or right click and choose paste. This will move the text from one document to another.

3 0
2 years ago
Read 2 more answers
Other questions:
  • Can you give me a free neon legendary pet in Adopt Me on Roblox!!!​ my user is: IamNathan215
    15·2 answers
  • Select the focus questions that emphasizes what is more important: (Select all that apply) a.What needs to be relegated to the b
    8·1 answer
  • Computers that belong to the same domain can access a common security database of user and computer account information. This ty
    5·1 answer
  • Servlet session and JSP session have differentabilities.<br>? True<br><br>? False
    15·1 answer
  • Which library research databases include information about articles published in magazines, journals, and newspapers? question 1
    7·1 answer
  • The _____ feature will mark all changes made to a document for others to review at a later time.
    13·1 answer
  • Why was the Internet first developed? Use details and information to explain your answer.
    6·1 answer
  • Correct all the mistakes in the following sentence:
    15·2 answers
  • Explain how the internet works​
    7·2 answers
  • In which drawer do you find blocks that allow you to use the A and B buttons on your micro:bit?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!