The implementation (.cpp file) of the Player class from the previous exercise:
void Player::setName (string playerName) {
name = playerName;
}
void Player::setScore (int playerScore){
score = playerScore;
}
string Player::getName (){
return name;
}
int Player::getScore(){
return score;
}
Where .cpp file extension is used?
In files with the CPP file suffix, applications created in the C++ programming language are kept. In one C++ project, there may be several CPP files used as application source code.
What is a programming language?
The term "programming language" refers to any collection of rules that are used to convert strings into other kinds of machine code, such as graphical program elements in the case of visual programming languages. A programming language is one kind of computer language that is used to implement algorithms in computer programming.
What is the C++ programming language used for?
Powerful general-purpose programming languages like C++ exist. It can be applied to the creation of operating systems, browsers, games, and other applications. Procedural, object-oriented, functional, and other programming paradigms are supported by C++. Because of this, C++ is both flexible and powerful.
Learn more about programming language: brainly.com/question/23959041
#SPJ4
The correct question is:
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 a name. The function returns no value.
A member function called secure that accepts a parameter and assigns it to a score. The function returns no value.
A member function called getName that accepts no parameters and returns the value of the name.
A member function called getScore that accepts no parameters and returns the value of the score.