Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3.1.2 Trax trax -sprinta:int +getSprintsO :int +setSprints(a:int) void +trax() +

ID: 3741914 • Letter: 3

Question

3.1.2 Trax trax -sprinta:int +getSprintsO :int +setSprints(a:int) void +trax() +trax() +taunt :atring +defenceBolster) :void +apecialAction) void *print) :void The variables specific to the Trax are sprints: This is a speeial stat used to represent the mobility of the Trax Gladiator They will use their sprints as part of thcir spccial action but they only have a finite number of them available in any given fight The methods of the class are: getter and sotter: A specific getter and setter for the sprints variable. trax(): This is the destructor for the class. It will print Trax removecd without the quotation marks and with a new line at the end

Explanation / Answer

class trax:public gladiator
{
int sprints;
public:
int getSprints()
{
return sprints;
}
void setSprints(int a)
{
sprints=a;
}
trax()
{
HP=16; AS=0.65; DS=0.55;
appeal=5; damage=1; sprints=5; seedR=100;
}
~trax()
{
cout<<"Trax removed"<<endl;
}
void print()
{
cout<<"HP: "<<HP<<endl;
cout<<"AS: "<<AS<<endl;
cout<<"DS: "<<DS<<endl;
cout<<"Appeal: "<<appeal<<endl;
cout<<"Damage: "<<damage<<endl;
cout<<"Sprints: "<<sprints<<endl;
cout<<"SeedR: "<<seedR<<endl;
}
void taunt()
{
cout<<"THRACE REMEMBERS!";
}
void defenceBolster()
{
AS-=0.05;
DS+=0.15;
}
void specialAction()
{
if(sprints>=1)
{
sprints--; //Decrementing 1 sprint (using it)
appeal+=2;
AS+=0.1;
}
}
};

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote