SlideShare a Scribd company logo
Sample Run:
Human attacks for 12 points!
Elf attacks for 4 points!
Balrog attacks for 27 points!
Balrog speed attack inflicts 49 additional damage points!
Cyberdemon attacks for 2 points!
Elf attacks for 42 points!
Creature 2 has 8 hit points.
Balrog attacks for 19 points!
Balrog speed attack inflicts 41 additional damage points!
Creature 1 has -10 hit points.
Creature 2 wins!
Press any key to continue . . .
PLEASE WRITE THIS CODE IN ONLY ONE FILE... NOT MULTIPLE FILES! Suppose that
you are creating a game. In this game we have four different types of creatures: humans,
cyberdemons, balrogs, and elves. To represent one of these creatures we might define a Creature
class as follows: class Creature / private: int type; // O human, 1 cyberdemon, 2 balrog, 3 elf int
strength; // How much damage we can inflict int hitpoints; // How much damage we can sustain
string getSpecies (); // Returns type of species, for Creature class // returns "unKnown" public:
Creature( ); // Initialize to human, 10 strength, 10 hit points Creature(int newType, int
newStrength, int newHit); // Initialize creature to new type, strength, hit points // Also add
appropriate accessor and mutator functions // for type, strength, and hit points int getDamage ();
// Returns amount of damage this creature // inflicts in one round of combat /; Here is an initial
implementation of the getspecies ( ) function: string Creature: getSpecies () f switch (type) f case
0: return "Human"; case 1: return "Cyberdemon"; case 2: return "Balrog"; case 3: return "Elf"; f
return "Unknown";
The getDamage ( ) function outputs and returns the damage this creature can inflict in one round
of combat. The rules for calculating the damage are as follows: - Every creature inflicts damage
that is a random number r, where 0

More Related Content

More from alertshoeshingkimand

Short essayThe next step in effective argumentation is the ability.pdf
Short essayThe next step in effective argumentation is the ability.pdfShort essayThe next step in effective argumentation is the ability.pdf
Short essayThe next step in effective argumentation is the ability.pdf
alertshoeshingkimand
 
Share your results from taking Organizational Culture Assessment Ins.pdf
Share your results from taking Organizational Culture Assessment Ins.pdfShare your results from taking Organizational Culture Assessment Ins.pdf
Share your results from taking Organizational Culture Assessment Ins.pdf
alertshoeshingkimand
 
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdfSeth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
alertshoeshingkimand
 
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdfse�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
alertshoeshingkimand
 
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdfSessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
alertshoeshingkimand
 
Set residents strategy to always defect and invaders strategy to t.pdf
Set residents strategy to always defect and invaders strategy to t.pdfSet residents strategy to always defect and invaders strategy to t.pdf
Set residents strategy to always defect and invaders strategy to t.pdf
alertshoeshingkimand
 
SENDER It is a helmet that contains a sensor for gases, vital s.pdf
SENDER  It is a helmet that contains a sensor for gases, vital s.pdfSENDER  It is a helmet that contains a sensor for gases, vital s.pdf
SENDER It is a helmet that contains a sensor for gases, vital s.pdf
alertshoeshingkimand
 
Service Values1. I build strong relationships and create Ritz-Carl.pdf
Service Values1. I build strong relationships and create Ritz-Carl.pdfService Values1. I build strong relationships and create Ritz-Carl.pdf
Service Values1. I build strong relationships and create Ritz-Carl.pdf
alertshoeshingkimand
 
send SERIALWISE with headings In F2021, the charity trained 19,591.pdf
send SERIALWISE with headings In F2021, the charity trained 19,591.pdfsend SERIALWISE with headings In F2021, the charity trained 19,591.pdf
send SERIALWISE with headings In F2021, the charity trained 19,591.pdf
alertshoeshingkimand
 
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdfSeptember 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
alertshoeshingkimand
 
Self-awareness involves being aware of different aspects of the self.pdf
Self-awareness involves being aware of different aspects of the self.pdfSelf-awareness involves being aware of different aspects of the self.pdf
Self-awareness involves being aware of different aspects of the self.pdf
alertshoeshingkimand
 
Select one theory from the following categories Sociological Syste.pdf
Select one theory from the following categories Sociological Syste.pdfSelect one theory from the following categories Sociological Syste.pdf
Select one theory from the following categories Sociological Syste.pdf
alertshoeshingkimand
 
Select one of the scenarios below and address the following Describ.pdf
Select one of the scenarios below and address the following Describ.pdfSelect one of the scenarios below and address the following Describ.pdf
Select one of the scenarios below and address the following Describ.pdf
alertshoeshingkimand
 
Select all correct statements related to the contribution of scienti.pdf
Select all correct statements related to the contribution of scienti.pdfSelect all correct statements related to the contribution of scienti.pdf
Select all correct statements related to the contribution of scienti.pdf
alertshoeshingkimand
 
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdf
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdfSeleccione todas las afirmaciones que se aplican al proceso de pre.pdf
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdf
alertshoeshingkimand
 
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdf
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdfSeleccione un tema de liderazgo relevante y de actualidad de los med.pdf
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdf
alertshoeshingkimand
 
Seleccione el orden correcto para los siguientes eventos clave en la.pdf
Seleccione el orden correcto para los siguientes eventos clave en la.pdfSeleccione el orden correcto para los siguientes eventos clave en la.pdf
Seleccione el orden correcto para los siguientes eventos clave en la.pdf
alertshoeshingkimand
 
Security analysis Perform security analysis on your proposed ransom.pdf
Security analysis Perform security analysis on your proposed ransom.pdfSecurity analysis Perform security analysis on your proposed ransom.pdf
Security analysis Perform security analysis on your proposed ransom.pdf
alertshoeshingkimand
 
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdfSe realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
alertshoeshingkimand
 
Sean Bedan a senior employee and was fired after he reported how a f.pdf
Sean Bedan a senior employee and was fired after he reported how a f.pdfSean Bedan a senior employee and was fired after he reported how a f.pdf
Sean Bedan a senior employee and was fired after he reported how a f.pdf
alertshoeshingkimand
 

More from alertshoeshingkimand (20)

Short essayThe next step in effective argumentation is the ability.pdf
Short essayThe next step in effective argumentation is the ability.pdfShort essayThe next step in effective argumentation is the ability.pdf
Short essayThe next step in effective argumentation is the ability.pdf
 
Share your results from taking Organizational Culture Assessment Ins.pdf
Share your results from taking Organizational Culture Assessment Ins.pdfShare your results from taking Organizational Culture Assessment Ins.pdf
Share your results from taking Organizational Culture Assessment Ins.pdf
 
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdfSeth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
 
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdfse�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
 
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdfSessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
 
Set residents strategy to always defect and invaders strategy to t.pdf
Set residents strategy to always defect and invaders strategy to t.pdfSet residents strategy to always defect and invaders strategy to t.pdf
Set residents strategy to always defect and invaders strategy to t.pdf
 
SENDER It is a helmet that contains a sensor for gases, vital s.pdf
SENDER  It is a helmet that contains a sensor for gases, vital s.pdfSENDER  It is a helmet that contains a sensor for gases, vital s.pdf
SENDER It is a helmet that contains a sensor for gases, vital s.pdf
 
Service Values1. I build strong relationships and create Ritz-Carl.pdf
Service Values1. I build strong relationships and create Ritz-Carl.pdfService Values1. I build strong relationships and create Ritz-Carl.pdf
Service Values1. I build strong relationships and create Ritz-Carl.pdf
 
send SERIALWISE with headings In F2021, the charity trained 19,591.pdf
send SERIALWISE with headings In F2021, the charity trained 19,591.pdfsend SERIALWISE with headings In F2021, the charity trained 19,591.pdf
send SERIALWISE with headings In F2021, the charity trained 19,591.pdf
 
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdfSeptember 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
 
Self-awareness involves being aware of different aspects of the self.pdf
Self-awareness involves being aware of different aspects of the self.pdfSelf-awareness involves being aware of different aspects of the self.pdf
Self-awareness involves being aware of different aspects of the self.pdf
 
Select one theory from the following categories Sociological Syste.pdf
Select one theory from the following categories Sociological Syste.pdfSelect one theory from the following categories Sociological Syste.pdf
Select one theory from the following categories Sociological Syste.pdf
 
Select one of the scenarios below and address the following Describ.pdf
Select one of the scenarios below and address the following Describ.pdfSelect one of the scenarios below and address the following Describ.pdf
Select one of the scenarios below and address the following Describ.pdf
 
Select all correct statements related to the contribution of scienti.pdf
Select all correct statements related to the contribution of scienti.pdfSelect all correct statements related to the contribution of scienti.pdf
Select all correct statements related to the contribution of scienti.pdf
 
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdf
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdfSeleccione todas las afirmaciones que se aplican al proceso de pre.pdf
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdf
 
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdf
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdfSeleccione un tema de liderazgo relevante y de actualidad de los med.pdf
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdf
 
Seleccione el orden correcto para los siguientes eventos clave en la.pdf
Seleccione el orden correcto para los siguientes eventos clave en la.pdfSeleccione el orden correcto para los siguientes eventos clave en la.pdf
Seleccione el orden correcto para los siguientes eventos clave en la.pdf
 
Security analysis Perform security analysis on your proposed ransom.pdf
Security analysis Perform security analysis on your proposed ransom.pdfSecurity analysis Perform security analysis on your proposed ransom.pdf
Security analysis Perform security analysis on your proposed ransom.pdf
 
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdfSe realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
 
Sean Bedan a senior employee and was fired after he reported how a f.pdf
Sean Bedan a senior employee and was fired after he reported how a f.pdfSean Bedan a senior employee and was fired after he reported how a f.pdf
Sean Bedan a senior employee and was fired after he reported how a f.pdf
 

Recently uploaded

How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 

Recently uploaded (20)

How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 

Sample RunHuman attacks for 12 points! Elf attacks for 4 poin.pdf

  • 1. Sample Run: Human attacks for 12 points! Elf attacks for 4 points! Balrog attacks for 27 points! Balrog speed attack inflicts 49 additional damage points! Cyberdemon attacks for 2 points! Elf attacks for 42 points! Creature 2 has 8 hit points. Balrog attacks for 19 points! Balrog speed attack inflicts 41 additional damage points! Creature 1 has -10 hit points. Creature 2 wins! Press any key to continue . . . PLEASE WRITE THIS CODE IN ONLY ONE FILE... NOT MULTIPLE FILES! Suppose that you are creating a game. In this game we have four different types of creatures: humans, cyberdemons, balrogs, and elves. To represent one of these creatures we might define a Creature class as follows: class Creature / private: int type; // O human, 1 cyberdemon, 2 balrog, 3 elf int strength; // How much damage we can inflict int hitpoints; // How much damage we can sustain string getSpecies (); // Returns type of species, for Creature class // returns "unKnown" public: Creature( ); // Initialize to human, 10 strength, 10 hit points Creature(int newType, int newStrength, int newHit); // Initialize creature to new type, strength, hit points // Also add appropriate accessor and mutator functions // for type, strength, and hit points int getDamage (); // Returns amount of damage this creature // inflicts in one round of combat /; Here is an initial implementation of the getspecies ( ) function: string Creature: getSpecies () f switch (type) f case 0: return "Human"; case 1: return "Cyberdemon"; case 2: return "Balrog"; case 3: return "Elf"; f return "Unknown"; The getDamage ( ) function outputs and returns the damage this creature can inflict in one round of combat. The rules for calculating the damage are as follows: - Every creature inflicts damage
  • 2. that is a random number r, where 0