Answer:
Following are the class definition to this question:
class Player//defining a Player class
{
private://use access specifier
string name;//defining string variable
int score;//defining integer variabl
public://use access specifier
void setName(string par_name);//declaring the setName method with one string parameter
void setScore(int par_score);//declaring the setScore method with one integer parameter
string getName();//declaring string method getName
int getScore();//declaring integer method getScore
};
Explanation:
In the above-given code, a Player class is defined, that hold a method and the variable which can be defined as follows: