Answer:
//Define the header file
#ifndef PLAYER_H
#define PLAYER_H
//header file.
#include <string>
//Use the standard namespace.
using namespace std;
//Define the class Player.
class Player
{
//Declare the required data members.
string name;
int score;
public:
//Declare the required
//member functions.
void setName(string par_name);
void setScore(int par_score);
string getName();
int getScore();
}
//End the definition
//of the header file.
#endif
Player.cpp:
//Include the "Player.h" header file,
#include "Player.h"
//Define the setName() function.
void Player::setName(string par_name)
{
name = par_name;
}
//Define the setScore() function.
void Player::setScore(int par_score)
{
score = par_score;
}
//Define the getName() function.
string Player::getName()
{
return name;
}
//Define the getScore() function.
int Player::getScore()
{
return score;
}