Hash Fellow robcat2075 Posted December 4, 2023 Hash Fellow Posted December 4, 2023 The switch structure simplifies situations that might be done with an if and many else ifs but only consider an integer value to decide which else if to do. sample project Golf scores are integers, so are the "par" values for the holes. A player's score on a hole can be just a number but it is often described by how many strokes above or below par it was. Also, there are names for each specific above or below possibility Write a program that prompts the user to input a par for a hole and the players number of strokes on that hole. Output par for the hole, the player's strokes, how many strokes above or below par he was and the golf word for that accomplishment (for up to 3 above or below par). Sample outputs: Golf Jargon! Enter your score for the hole: 5 Enter the par for the hole: 6 Your score was 5 Par for the hole was 6 You were 1 stroke(s) below par. You played a birdie Golf Jargon! Enter your score for the hole: 7 Enter the par for the hole: 6 Your score was 7 Par for the hole was 6 You were 1 stroke(s) above par. You played a bogey. Quote
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.