Starting from:

$25

CPSC121-Lab 8 Using the Standard Library & Classes Solved

Using the gladiator class from before, we are going to create two armies that will attack each other. This will be accomplished by using the <vector library

Write a program that performs the following:

1.     Create two vectors of Gladiators (see last section of Chapter 7), one for the Red team, and one for the Blue team

2.     Show the number of fighters alive on each team

3.     Present the user with the following menu

a.     Take Turn

i.             Randomly select between red team and blue team

ii.            Use the first/next fighter on that team to attack a random enemy in the enemy team

1.     Any fighters that get get killed should be removed from the team (With a notification)!

2.     Describe what happened each attack, including which team the attacker is part of.

iii.          Repeat this process until all fighters have had a chance to attack.

b.     Add Fighters

i.             Add one fighter to both teams

1.     It would be easier to give fighters a name randomly selected from a list (array) of potential names, than to ask the user for two names every time they want to add more fighters

2.     Show the stats of both fighters as/after they have been added

c.      Exit Program

4.     Return to step 2

More products