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
The following 2D array has been created:
Airida [17]

Answer:

public class Main

{

public static void main(String[] args) {

 

 int [][] a = new int[4][5];

 

 a[0][0] = 1;

 a[0][1] = 2;

 a[0][2] = 3;

 a[0][3] = 4;

 a[0][4] = 5;

 a[1][0] = 10;

 a[1][1] = 9;

 a[1][2] = 8;

 a[1][3] = 7;

 a[1][4] = 6;

 a[2][0] = 11;

 a[2][1] = 12;

 a[2][2] = 13;

 a[2][3] = 14;

 a[2][4] = 15;

 a[3][0] = 20;

 a[3][1] = 19;

 a[3][2] = 18;

 a[3][3] = 17;

 a[3][4] = 16;

 

 for (int i = 0; i < 4; i++) {

     for (int j = 0; j < 5; j++){

         System.out.print(a[i][j] + " ");

     }

     System.out.print("\n");

 }

}

}

Explanation:

  • Inside the main method, initialize the 2D array with their respective values at the appropriate indexes.
  • Iterate over the 2D array using a nested For loop.
  • The outer loop iterates over the rows, while the inner loop iterates over the columns of the 2D array respectively.
  • Finally inside the nested For loop, print the value of 2D array using the i and j index.

Output:

1 2 3 4 5

10 9 8 7 6

11 12 13 14 15

20 19 18 17 16

4 0
3 years ago
Read 2 more answers
In the event you get pulled over for a traffic stop, describe the situation from the police officer's perspective and list at le
Zepler [3.9K]

Answer:

Dealing with traffic related issues

Explanation:

The police officer are primarily charged with the primary responsibilities of maintaining law and order in any given society.

from the police officer's perspective when I get pulled for a traffic stop it is expected that

  • as a first rule is to always be polite to the officer.  Greet the officer with a warm and friendly smile as this will lower his or her fears.
  • Always follow instructions and give the officer your license, registration and insurance information when they ask for it.  
  • Treat the officer with respect and courtesy.
  • Always remove your sunglasses and maintain eye contact with the officer.   Most law enforcement officials view this as a sign that you are being truthful.
  • Remain as inconspicuous as possible.   If the officer doesn’t remember certain aspects of the incident, this can work to your advantage in court.

The additional two (2) things you need to do make traffic stop go smoothly are:

1) Ensure you maintain a high sense of dutifulness in cause of performing your responsibility,

2) Ensure you put on a user friendly welcome to the road users this help to make them feel safe and secured.

5 0
3 years ago
Read 2 more answers
In 1-2 sentences, describe some keyboard shortcuts you have used during this lesson to save you time.
Aneli [31]
Command C command V command A
5 0
3 years ago
Read 2 more answers
Who created the first photograph
Tems11 [23]
Nicephore Niepce created the first photograph.
8 0
3 years ago
Read 2 more answers
An administrative assistant types a document, saves, and prints. The assistant is using _____.
9966 [12]
The answer to your question is software. 
3 0
3 years ago
Other questions:
  • In Microsoft Word you can access the _______ command from the "Mini toolbar".
    9·1 answer
  • What is the pen tools use in Photoshop?
    6·2 answers
  • If you are driving at night, you should not use high-beam headlights within _________ of oncoming vehicles. Florida Road Rules 4
    9·2 answers
  • What's the difference between intranet and extranet ​
    9·1 answer
  • When network cards are communicating, bits can occasionally be corrupted in transmission?
    5·1 answer
  • If an author is creating a reference list and wants the second and succeeding lines indented for a reference, they should select
    13·2 answers
  • When can we feel electricity?? Tell me the volt
    15·1 answer
  • How many clients has<br> Accenture engaged globally on blockchain?
    12·1 answer
  • Help101111 avatar can we be friend's please? My name is Keegan. what is yours?
    12·1 answer
  • You have two identical print devices that are set up in a work room. Currently, the Windows print server has two printers config
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!