I dont get it. Why can't you fix this code? There are 3 errors. That's it. So why can't you do it? Give me a valid reason. Is it really complex or you just don't want to do it? I got this code from you so I know you are lying. You are giving me the same PATHETIC excuse again and again. Just say that you don't want to do it. If you do I will leave it. The code is in the link. Your website only allows 5000 words https://docs.google.com/document/d/1HvSmPG3aG-xMGHkxbTNf4fj_CbYc2axmuBbVDPCOEIE/edit?usp=drivesdk
I dont get it. Why can't you fix this code? There are 3 errors. That's it. So why can't you do it? Give me a valid reason. Is it really complex or you just don't want to do it? I got this code from you so I know you are lying. You are giving me the same PATHETIC excuse again and again. Just say that you don't want to do it. If you do I will leave it. The code is in the link. Your website only allows 5000 words https://docs.google.com/document/d/1HvSmPG3aG-xMGHkxbTNf4fj_CbYc2axmuBbVDPCOEIE/edit?usp=drivesdk
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
I dont get it. Why can't you fix this code? There are 3 errors. That's it. So why can't you do it? Give me a valid reason. Is it really complex or you just don't want to do it? I got this code from you so I know you are lying. You are giving me the same PATHETIC excuse again and again. Just say that you don't want to do it. If you do I will leave it.
The code is in the link. Your website only allows 5000 words
https://docs.google.com/document/d/1HvSmPG3aG-xMGHkxbTNf4fj_CbYc2axmuBbVDPCOEIE/edit?usp=drivesdk

Transcribed Image Text:#include<iostream>
#include<cstdlib>
#include<string>
#include<time.h>
using namespace std;
class AttackInfo{
public:
};
int dmg;
string description;
AttackInfo()
AttackInfo(int a, string b){
dmg = a;
description = b;
class BaseCharacter{
private:
}
string name;
int maxHP,presentHP,dodgeChance;
public:
int strength, agility,intelligence, baseDamage;
public:
BaseCharacter() {
BaseCharacter(string a, int b, int c, int d, int e, int f, int g){
name = a;
strength = b;
agility = c;
intelligence = d;
maxHP = e;
presentHP = maxHP;
dodgeChance = f;
baseDamage=g;
}
AttackInfo primaryAttack(){
return AttackInfo(baseDamage,"strikes at");
}
at");
AttackInfo secondaryAttack(){
return AttackInfo(baseDamage,"");
}
}
void takeDamage(int a){}
string toString(){
return "Name: "+getName()+"Max HP: "+to_string(getMaxHp())+"
Present HP: "+to_string(getPresentHP())+"Dodge Chance:
"+to_string(get DodgeChance());
}
};
AttackInfo getAttack(){
return primaryAttack();
};
class Warrior: public BaseCharacter{
private:
string getName(){return name;}
int getMaxHp(){return maxHP;}
int getPresentHP(){return presentHP;}
void setPresentHP(int a){presentHP=a;}
int getDodgeChance(){return dodgeChance;}
void setDodgeChance(int a){dodgeChance=a;}
int resistance;
public:
Warrior(string a, int b, int c, int d, int e, int f, int g, int
h):BaseCharacter(a,b,c,d,e,f,g){
resistance = h;
}
AttackInfo primaryAttack(){
return AttackInfo(baseDamage+baseDamage*(strength/20),"strikes
}
AttackInfo secondaryAttack(){
int a = getDodge Chance();
if(a<50)
a+=(agility/2);
setDodgeChance(a);
return AttackInfo(2,"gets more agile and leaps at");
}
AttackInfo getAttack(){
srand(time(0));
int a = 1+ (rand() % 10);
if (a==1)
return secondaryAttack();
else
return primaryAttack();
}
void takeDamage(int a){
int b = getPresentHP();
b -= a;
setPresentHP(b);
}
string toString(){
return "Name: "+getName()+"Max HP: "+to_string(getMaxHp())+"
Present HP: "+to_string(get PresentHP()+"Dodge Chance:
"+to_string(get DodgeChance());
}
};
class Mage: public BaseCharacter{
public:
Mage(string a, int b, int c, int d, int e, int f, int g):BaseCharacter(a,b,c,d,e,f,
g){
AttackInfo secondaryAttack(){
return
a fireball at");
}
Attackinfo(baseDamage+baseDamage*(intelligence/20),"throws
AttackInfo getAttack(){
srand(time(0));
int a = 1+ (rand() % 10);
if (a<=3)
return secondaryAttack();
else
return primaryAttack();
}
void takeDamage(int a){
int b = getPresentHP();
b = a;
setPresentHP(b);
}
string toString(){
return "Name: "+getName()+"Max HP: "+to_string(getMaxHp())+"
Present HP: "+to_string(getPresentHP())+"Dodge Chance:
"+to_string(get DodgeChance());
}
};
class Priest: public BaseCharacter{
public:
Priest(string a, int b, int c, int d, int e, int f, int g):BaseCharacter(a,b,c,d,e,f,
g){
AttackInfo secondaryAttack(){
int a = getPresentHP();
a += 5+ (intelligence/20);
setPresentHP(a);
return Attackinfo(0,"heals themselves and smiles at");
}
AttackInfo getAttack(){
srand(time(0));
int a = 1+ (rand() % 10);
if (a<=4)
return secondaryAttack();
else
return primaryAttack();
}
void takeDamage(int a){
int b = getPresentHP();
b -= a;
setPresentHP(b);
}
string toString(){
return "Name: "+getName()+"Max HP: "+to_string(getMaxHp())+"
Present HP: "+to_string(getPresentHP())+"Dodge Chance:
"+to_string(get DodgeChance());
}
![class ArenaManager{
private:
BaseCharacter *contestantList;
int maxContestant;
int numContestant;
public:
ArenaManager(int
maxContestant
numContestant = 0;
}
bool addContestant(char type, string a, int b, int c, int d, int e, int f, int g){
if(type=='m')
BaseCharacter *contestantList[numContestant] = { new
Mage(a,b,c,d,e,f,g) };
Priest(a,b,c,d,e,f,g) };
else
return false;
else if(type=='p')
BaseCharacter *contestantList[numContestant] = { new
}
bool addContestant(char type, string a, int b, int c, int d, int e, int f, int g, int
h){
}
}
numContestant+=1;
return true;
Warrior(a,b,c,d,e,f,g,h) };
else
a): contestantList(new BaseCharacter[a]){
= a;
if(type=='w')
BaseCharacter *contestantList[numContestant] = { new
return false;
numContestant+=1;
return true;
BaseCharacter viewContestant(int a){
return contestantList[a-1];
}
void simulateChallenge(int a, int b){
srand(time(0));
int x = 1+ (rand() % 10);
BaseCharacter attacker,counterattacker;
if(x<=5){
attacker = contestantList[a-1];
counterattacker = contestantList[b-1];
}
else{
}
}
attacker = contestantList[b-1];
counterattacker = contestantList[a-1];
while(1){
cout << attacker.toString() << endl;
cout << counterattacker.toString() << endl;
AttackInfo a1,a2;
counterattacker.getName() << endl;
AttackInfo a1,a2;
a1 = attacker.getAttack();
cout << attacker.getName() <<" " << a1.description << " " .
counterattacker.takeDamage(a1.dmg);
if(counterattacker.getPresentHP() <=0){
cout << attacker.getName() << "wins!!!" << endl;
break;
attacker.getName() << endl;
}
a2 = counterattacker.getAttack();
cout << counterattacker.getName() <<" " << a2.description <<
attacker.takeDamage(a2.dmg);
if(attacker.getPresentHP()<=0){
cout << counterattacker.getName() << " wins!!!" << endl;
break;
}
}
string viewAllContestants(){
string a;
for(int i=0; i<numContestant; i++){
a+=to_string(i)+"."+contestantList[i].toString()+"\n";
}
return a;
}
int main() {
int option=0;
ArenaManager ar(10);
do{
cout << "1.Add Contestant\n2. View Specific Contestant\n3. View All
Contestants\n4. Simulate Challenge\n5. Exit"<<endl;
cin >> option;
if(option==1){
int option2;
cout << "1. Warrior\n2. Mage\n3. Priest" << endl;
cin >> option2;
string a;
int b,c,d,e,f,g,h;
cout << "Name: " << endl;
cin >> a;
cout << "Strenght: " << endl;
cin >> b;
cout << "Agility: " << endl;
cin >> c;
cout << "Intelligence: " << endl;
cin >> d;
cout << "Max HP: " << endl;
cin >> e;
cout << "Dodge CHance: " << endl;
cin >> f;
cout << "Base Damage: " << endl;
cin >> g;
if(option2==1){
cout << "Resistance: " << endl;
cin >> h;
imptomi2,
cout << "1. Warrior\n2. Mage\n3. Priest" << endl;
cin >> option2;
string a;
int b,c,d,e,f,g,h;
cout << "Name: " << endl;
cin >> a;
cout << "Strenght: " << endl;
cin >> b;
cout << "Agility: " << endl;
cin >> c;
cout << "Intelligence: " << endl;
cin >> d;
cout << "Max HP: " << endl;
cin >> e;
cout << "Dodge CHance: " << endl;
cin >> f;
cout << "Base Damage: " << endl;
cin >> g;
if(option2==1){
cout << "Resistance: " << endl;
cin >> h;
ar.addContestant('w',a,b,c,d,e,f,g,h);
}
else if(option2==2)
else if(option2==3)
ar.addContestant('m',a,b,c,d,e,f,g,h);
ar.addContestant('p',a,b,c,d,e,f,g,h);
}
}
else if(option==2){
cout << ar.viewAllContestants() << endl;
int option2;
cin >> option2;
BaseCharacter temp = ar.viewContestant (option2);
cout << temp.toString() << endl;
else if(option==3){
cout << ar.viewAllContestants() << endl;
}
else if(option==4){
cout << ar.viewAllContestants() << endl;
int option2,option3;
cin >> option2;
cin >> option3;
ar.simulateChallenge(option2,option3);
}while(option!=5);
<<](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff3d14749-a37f-49b6-af18-abad2bb46604%2Faf83675b-570e-43bb-aaa3-735d3b30c8b7%2Fq61dza5_processed.jpeg&w=3840&q=75)
Transcribed Image Text:class ArenaManager{
private:
BaseCharacter *contestantList;
int maxContestant;
int numContestant;
public:
ArenaManager(int
maxContestant
numContestant = 0;
}
bool addContestant(char type, string a, int b, int c, int d, int e, int f, int g){
if(type=='m')
BaseCharacter *contestantList[numContestant] = { new
Mage(a,b,c,d,e,f,g) };
Priest(a,b,c,d,e,f,g) };
else
return false;
else if(type=='p')
BaseCharacter *contestantList[numContestant] = { new
}
bool addContestant(char type, string a, int b, int c, int d, int e, int f, int g, int
h){
}
}
numContestant+=1;
return true;
Warrior(a,b,c,d,e,f,g,h) };
else
a): contestantList(new BaseCharacter[a]){
= a;
if(type=='w')
BaseCharacter *contestantList[numContestant] = { new
return false;
numContestant+=1;
return true;
BaseCharacter viewContestant(int a){
return contestantList[a-1];
}
void simulateChallenge(int a, int b){
srand(time(0));
int x = 1+ (rand() % 10);
BaseCharacter attacker,counterattacker;
if(x<=5){
attacker = contestantList[a-1];
counterattacker = contestantList[b-1];
}
else{
}
}
attacker = contestantList[b-1];
counterattacker = contestantList[a-1];
while(1){
cout << attacker.toString() << endl;
cout << counterattacker.toString() << endl;
AttackInfo a1,a2;
counterattacker.getName() << endl;
AttackInfo a1,a2;
a1 = attacker.getAttack();
cout << attacker.getName() <<" " << a1.description << " " .
counterattacker.takeDamage(a1.dmg);
if(counterattacker.getPresentHP() <=0){
cout << attacker.getName() << "wins!!!" << endl;
break;
attacker.getName() << endl;
}
a2 = counterattacker.getAttack();
cout << counterattacker.getName() <<" " << a2.description <<
attacker.takeDamage(a2.dmg);
if(attacker.getPresentHP()<=0){
cout << counterattacker.getName() << " wins!!!" << endl;
break;
}
}
string viewAllContestants(){
string a;
for(int i=0; i<numContestant; i++){
a+=to_string(i)+"."+contestantList[i].toString()+"\n";
}
return a;
}
int main() {
int option=0;
ArenaManager ar(10);
do{
cout << "1.Add Contestant\n2. View Specific Contestant\n3. View All
Contestants\n4. Simulate Challenge\n5. Exit"<<endl;
cin >> option;
if(option==1){
int option2;
cout << "1. Warrior\n2. Mage\n3. Priest" << endl;
cin >> option2;
string a;
int b,c,d,e,f,g,h;
cout << "Name: " << endl;
cin >> a;
cout << "Strenght: " << endl;
cin >> b;
cout << "Agility: " << endl;
cin >> c;
cout << "Intelligence: " << endl;
cin >> d;
cout << "Max HP: " << endl;
cin >> e;
cout << "Dodge CHance: " << endl;
cin >> f;
cout << "Base Damage: " << endl;
cin >> g;
if(option2==1){
cout << "Resistance: " << endl;
cin >> h;
imptomi2,
cout << "1. Warrior\n2. Mage\n3. Priest" << endl;
cin >> option2;
string a;
int b,c,d,e,f,g,h;
cout << "Name: " << endl;
cin >> a;
cout << "Strenght: " << endl;
cin >> b;
cout << "Agility: " << endl;
cin >> c;
cout << "Intelligence: " << endl;
cin >> d;
cout << "Max HP: " << endl;
cin >> e;
cout << "Dodge CHance: " << endl;
cin >> f;
cout << "Base Damage: " << endl;
cin >> g;
if(option2==1){
cout << "Resistance: " << endl;
cin >> h;
ar.addContestant('w',a,b,c,d,e,f,g,h);
}
else if(option2==2)
else if(option2==3)
ar.addContestant('m',a,b,c,d,e,f,g,h);
ar.addContestant('p',a,b,c,d,e,f,g,h);
}
}
else if(option==2){
cout << ar.viewAllContestants() << endl;
int option2;
cin >> option2;
BaseCharacter temp = ar.viewContestant (option2);
cout << temp.toString() << endl;
else if(option==3){
cout << ar.viewAllContestants() << endl;
}
else if(option==4){
cout << ar.viewAllContestants() << endl;
int option2,option3;
cin >> option2;
cin >> option3;
ar.simulateChallenge(option2,option3);
}while(option!=5);
<<
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY