Question: Write the implementation ( . cpp file ) of the Player class from the previous exercise. Again, the class contains: A data member name of
Write the implementation cpp file of the Player class from the previous exercise. Again, the class contains:
A data member name of type string.
A data member score of type int.
A member function called setName that accepts a parameter and assigns it to name. The function returns no value.
A member function called setScore that accepts a parameter and assigns it to score. The function returns no value.
A member function called getName that accepts no parameters and returns the value of name.
A member function called getScore that accepts no parameters and returns the value of score.
Note: Do not write an #include directive in your code. It will cause an error in the Revel system. Simply write the definitions of the class's member functions.
class Player
private: string name;
int score;
public:
void setNamestring;
void setScoreint;
string getName;
int getScore; ;
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
