Question: Help me solve please You are to write the definition for a class named CGame. Followings are details for data members and member functions for
Help me solve please
You are to write the definition for a class named CGame. Followings are details for data
members and member functions for the class:
There public data members:
ID string
Duration GameDuration
One private data member:
PayRate float between $ and $
One default constructor to initialize the data members to G ZERO, for
duration and rate respectively.
quad One parameterized constructor to initialize the data members to specific values. If
value fails the above requirements, set it as the value of the default constructor.
A function getInfo to get inputs for the information of a game.
A function showInfo to display the information of a game as format:
ID Duration PayRate.
One mutator and one accessor for the private data member.
Implement all of the member functions of the class CGame. Then, use the following
function main as a sample to test all of member functions of the class.
void main
CGame firstGame;
cout "The default information of the first game:
;
firstGame.showInfo;
cout "Update information of the first game:
;
firstGame.getInFo;
cout "The updated information of the first game:
;
firstGame.showInfo;
cout "Modifying the pay rate to $
;
firstGame.setPayRate;
cout "The pay rate amount is now: firstGame.getPayRate endl;
CGame secondGame W EIGHTY, ;
cout "The initial information of the second game:
;
secondGameshowInfo;
cout "Modifying the pay rate to $
;
secondGamesetPayRate ;
cout "The modified pay rate is now: secondGamegetPayRate endl;
cout "The updated information of the second game:
;
secondGameshowInfo;
You are to define an enumeration type RefereeGrade including values UNKNOWN, CLUB, STATE, NATIONAL and FIFA.
You are to write the definition for a class named CReferee. Followings are details for data members and member functions for the class:
Three public data members:
ID string
First Name string
Last Name string
One private data member:
Grade RefereeGrade
One default constructor to initialize the data members to R "None", "None" and UNKNOWN for ID first name, last name and grade respectively.
One parameterized constructor to initialize the data members ID first name, last name and grade to specific values.
A function getInfo to get inputs for the information of a referee.
A function showInfo to display the information of a referee as format:
ID First Last Grade.
One mutator and one accessor for the private data member.
Implement all of the member functions of the class CReferee. Then, use the following function main as a sample to test all of member functions of the class.
void main
CReferee firstRef;
cout "The default information of the first ref:
;
firstRef.showInfo;
firstRef.getInFo;
cout "The inputted information of the first ref:
;
firstRef.showInfo;
cout "Modifying the grade to NATIONAL.
;
firstRef.setGradeNATIONAL;
cout "The referee grade is now: firstRef.getGrade endl;
CReferee secondRef R "Arby", "Sample", CLUB;
cout "The initial information of the second ref:
;
secondRefshowInfo;
cout "Modifying the grade to STATE.
;
secondRefsetGrade STATE;
cout "The modified grade is now: secondRefgetGrade endl;
cout "The updated information of the second ref:
;
secondRefshowInfo;
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
