Question
C++ PROGRAM ASSIGNMENT. NEED A C++ PROGRAM. Thank you 1. The program needs a Frisbee Golfer class. 2. Use the class to find the Frisbee
C++ PROGRAM ASSIGNMENT.
NEED A C++ PROGRAM. Thank you
1. The program needs a Frisbee Golfer class.
2. Use the class to find the Frisbee golfer average.
3. Class should have such public methods that return the golfers name or the golfers ID, and include methods that can set ID and golfers first and last name.
4. Prompt the user for the name for the golfer, the total number of games and the total number of tosses for two golfers.
5. After Information from the user has been validated, create an object for the golfer.
a. Have the program assign each golfer an ID.
b. Internally the class should track the total number of tosses for all games and the total number of games.
b. The players average will be calculated using the total tosses and total number of games.
6. Add the scores for at least one additional game per player.
7. Display each players name, id, and average.
Be sure to include in your program:
An appropriate header comment,
A constructor for the Golfer Class that receives a Name, ID, Total Tosses, and number of games.
Validate tosses and games to ensure no negative numbers.
Provide Accessor/Get Methods that will return Name, ID, Total Tosses, Number of Games, and Average (tosses per game)
Provide Mutator/Set Methods that will be able to change a previously recorded Golfers, Name and ID. Nothing else.
Provide Method AddScore that will add a number of tosses for another game.
(Validate tosses for no negative numbers.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started