Question: C++ This code had duplicate parts. Create one code path. All constructor should call the working constructor. #include #include Player.h Player::Player() { this->Name = Joe;
C++
This code had duplicate parts. Create one code path. All constructor should call the working constructor.
#include
#include "Player.h"
Player::Player()
{
this->Name = "Joe";
this->average = 0.0;
}
Player::Player(string Name)
{
this->Name = Name;
this->average = 0.0;
}
Player::Player(string Name, double average)
{
this->Name = Name;
this->average = average;
}
void Player::setPlayer(double avg, string Name)
{
this->average = avg;
this->Name = Name;
}
double Player:: getAverage()
{
return this ->average;
}
string Player::getName()
{
return this->Name;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
