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 haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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