[Solved] CPSC 121-Lab 8

$25

File Name: CPSC_121-Lab_8.zip
File Size: 131.88 KB

SKU: [Solved] CPSC 121-Lab 8 Category: Tag:
5/5 - (1 vote)

Using the standard library, classes

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
    1. Take Turn
      1. Randomly select between red team and blue team
      2. 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.
  • Repeat this process until all fighters have had a chance to attack.
  1. Add Fighters
    1. 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
    2. Exit Program
  2. Return to step 2

I will soon make a set of bug-free gladiator method definitions for you to use. We will be including it and the class definition as separate files in this project we will go over how to compile it together in lab.

Menu input should accept either a single lowercase char or an integer, prompts should tell user what to enter.

Points:

1.5 Documentation, readability, format

1.5 Filename and Header

2 Output testing

  • Proper program flow (conditions, loops, functions, etc)
  • Proper use of vectors

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CPSC 121-Lab 8
$25