Write a program that will keep track of golf handicaps.

Assignment Help Programming Languages
Reference no: EM13221440

Write a program that will keep track of golf handicaps. To find a player's handicap, you will need to know the player's score, the course rating and the course slope.

Step 1 is to get a player to enter 5 scores. For this lesson we will assume all rounds were played at Wedgewood Country Club which has a course rating of 681. and a slope of 115. Your program should tell the player that he will enter 5 rounds from Wedgewood and you will calculate his handicap. You will need a loop to keep track of how many scores he's entered.

Step 2 is to find the players "Handicap Differential" for each score entered. The formula for this is: Handicap Differntial = (player's score - course rating) * 113 / slope. An example for Bob who scores a 98 at Wedgewood is: Handicap Differential = (98 - 68.1) * 113 / 115. Using this formula, Bob's handicap differential would be 29.38. You can do this in a module that is called within the loop after the score is entered.

Step 3 is to store the handicap differential in an array. This can also be done in a module.

Step 4 is to repeat steps 1 through 3 until the user has entered 5 scores and you have calculated 5 handicap differentials. This will end the loop that you set up to get 5 scores.

Step 5 is to find the average handicap differential. To do this you will need to loop through the handicap differential array and add all 5 values together into a 'total' variable. Once you have the total of the handicap differentials in a variable, you will then need to divide this variable by 5, giving you the average of the 5 handicap differentials. Once you have the average you will exit the loop.

Step 6 is to multiply the handicap differential by 0.96 and round it to a whole number. This will give you the players final handicap. 

Step 7 - You will need to display the player's handicap and a message to the player depending on his handicap. If the handicap is >= 36, display "Your handicap is greater than the maximum allowed. You will play with a 36.4 handicap." If the handicap is <36 and > 18, display "Not bad, but there's room for improvement." If the handicap is <= 18, display "You might want to think about going professional.


Here is an example of final output.

"Hello Joe."

"Your handicap is 27."

"Not bad, but there's room for improvement." 

Reference no: EM13221440

Questions Cloud

Compute the molecular weight of sulfur : Calculate the molecular weight of sulfur if 35.5 grams of sulfur dissolve in 100.0 grams of CS2 to produce a solution that has a boiling point of 49.49 oC.
Write a procedure should named get_frequencie : Write a procedure should named Get_frequencies that constructs a character frequency table
What is the impact to future cash-flows that may emerge : With the current U.S. economy in a weakened state, many companies are reluctant to implement any capital improvements or capital expenditures in fear of the economic uncertainty that exists that may negatively impact the cash-flow of the organizat..
Discuss why it is relevant to the discussion : The annotation should consist of a brief (usually about 150 words) descriptive and evaluative paragraph for the purpose of informing the reader of the relevance, accuracy, and quality of the content of the article.
Write a program that will keep track of golf handicaps. : Write a program that will keep track of golf handicaps. To find a player's handicap, you will need to know the player's score, the course rating and the course slope.
Explain what is the mol of o2 : If there's a mixture of O2 and N2, and the mol of N2 is 0.605 mol, and fraction (f) of O2 is 0.251; then, what is the mol of O2?
Explain the concept of structural holes : Explain the concept of structural holes and it affects value creation and value extraction. Based on this discussion, determine some of the skills essential to be a successful general manager.
Compute the density in grams per liter : Calculate the density in grams per liter of the following gases at 29.7 degrees Celsius and 700 torr: NH3, N2, N2O
What would the profit maximizing price and quantity be : A monopolist can produce its output at a constant average and constant marginal cost of: ATC = MC = 5 The monopoly faces a demand curve given by the following function: Q= 53-P And a marginal revenue curve that is given by the function: MR = 53 - ..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program to solve to find loan on tv

Write a program to solve follwoing problem: A TV set is bought with loan of $563 to be paid off with 5 monthly payments of $116. Interest rate is 1 percent per month.

  Develope a tutoring software for an elementary school

You are the project manger for a company that is planning to develope a tutoring software for an elementary school that will follow their curriculum create a work breadown structure.

  Write a program to read the data from csv file

Write a program that will read the data from the CSV file into an ArrayList of State objects where each State object stores information about all County objects for that state.

  Write application to which create-print random phone number

Write down the application which creates and prints random phone number of form xxx-xxx-xxxx. Write the dashes in output. Do not let first three digits contain 8 or 9.

  Write java program which declares the array alpha

Write the Java program which declares the array alpha of 50 elements. Initialize array so that first 25 elements are equal to square of the index variable and the last 25 elements

  Program to run at end of semester to produce grade summary

Write the program for instructor to run at the end of the semester to produce grade summary for one student, as shown in box below.

  Program to do multiplications using divide-and-conquer

Recall that xy = (xy/2)2 if y is even. Use this to write down the function which calculates xy, suppose that y is a power of 2.

  Program to read employee information in the array of objects

Let the program which will read employee information into the array of objects, sort array by employee identification number, write the sorted array.

  Computing average net profit per sale of product

Your company bought 250,000 online advertising impressions and made average net profit per sale of product of $5.

  Create command line based application for perfect hundred

Create a COMMAND LINE based application to play a game called Perfect Hundred. In this game, the user/player competes against the computer.

  Program to find sum-difference of two complex numbers

Program should ask user to enter two complex numbers and it automatically finds it sum, difference, coefficient, product conjugate.

  Create set-list of enumerated constants called week

Create set/list of enumerated constants called week which contains days of week. Have variable called today that is of kind week. Allot a value to today.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd