Question: C + + ONLY PLEASE First, you will need to have an Player . h file, which contains the Player class interface that can hold
C ONLY PLEASE
First, you will need to have an Playerh file, which contains the Player class interface that
can hold information about players on a team. Include an include guard as discussed in the text.
The class should have the following private member variables:
Member Variable
Name
and Description
playerNumber An int that holds an playerss ID number. This number cannot
be less than or more than Input validation must be done by
the driver program
playerName A string that holds a players name, the name may contain a
space. such as: John Doe. No input validation needed.
playerAge An integer that contains the players age at the start of a baseball
season. The range of values is through inclusive. Input
validation must be done by the driver program.
batAverage A double that holds the batAverage of an player, the batAverage
should be positive including decimal number less than or
equal to Input validation must be done by driver program.
The class should have the following public member functions. You may not create more member
functions than the six listed below:
Member Function
Name
Description
Constructor This constructor will:
setplayerNumber to be
playerName to be none
playerAge to be
batAverage to be
Overloaded
constructor
This constructor should have four input parameters, integer for
playerNumber, a string for playerName, an integer for players age, and a
double for batAverage. Each parameter should be assigned to the
corresponding member variables
Destructor The destructorshould display a message in the following format:
playerNumberplayerName removed example John Doe removed
setPlayerNumber Accepts an int argument and copies it into the playerNumber member
variable
setPlayerName Accepts a string argument and copies it into the playerName member
variable
setPlayerAge Accepts an integer argument and copies it into the playerAge member
variable
setBatAverage Accepts a double argument and copies it into the batAverage member
variable
getPlayerName Returns the value in playerName
getPlayerNumber Returns the value in playerNumber
getPlayerAge Returns the value in playerAge
getBatAverage Returns the value in batAverage
Class declarations should be in Player.h and member function definitions should be in
Player.cpp Do not define any inline functions. The driver program should be in a file name
PlayerDrivercpp All three programs must be submitted separately to the Canvas assignment.
Do not submit a zip file
Driver program PlayerDrivercpp should have the following functions. And should also
dynamically allocate a Player array of the number of players entered by the user.
Player ptrPlayer new Playersize; size is entered by the user
void displayAllPlayerRecordconst Player
ptrEmp, const int size
Display in the following format described
below
void getInputPlayer ptrEmp, const int size Ask user to enter all values for all Player
objects, input must be validated. Use
cin.ignore in appropriate places.
You probably also need the following functions in your driver program not part of the
requirement getInput function above should call these functions:
int getID Validate the input of an ID ID cannot be less than or more than
int getAge Validate the age is greater than or equal to and less than or equal
to
double getBatAverage Validate the input of a batAverage, make sure the batAverage is
greater than or equal to zero and less than
Other Requirements:
One function should only handle one task. Feel free to add more functions to the driver
program if needed. But no function should be more than half a page. You may not
addchange member functions.
Use string line for line in the sample output
The main function should be less than half a page with return included.
Main function should only call other functions and display messages.
Your output should be similar to the provided output attached below including format
and messages.
Submit your three programs to the Canvas assignment before the due date and time.
Each program should have a heading name course number etc.
In the headings of each program, you should list other files included.
For example, in Player.h you should say other files included: Player.cpp
PlayerDriver.cpp
Use #ifndef.. etc. on top of your Player.h
Sample Output notice the line separator presented here has
Enter the number of playersmust be greater than zero:
The number of players must be greater than reenter:
The number of players must be greater than reenter:
Enter player s number:
Enter player s name: John Hunter
Enter player s age:
The player's age must be a between and inclusive
Reenter player s age:
Enter player s batting average:
Enter player s number:
The player's number must be a positive number less than
Reenter player s number:
Enter player s name: Mike Austin
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
