Starting from:

$25

CPSC 121 Lab-7

Using Classes
The following program is going to revolve around creating and using the “Gladiator” class, which
is included in your github repository. You must use that class definition in your project. In
addition to writing a main function that uses the class correctly, you will also be responsible for
defining 4 member functions of the gladiator class.
Write a program that performs the following:
1. Tell the user that they are going to be hosting a fight! But first, we need to…
2. Declare your gladiator objects. This will call the constructor, which is where you will
assign stats and assign, or ask for, a name.
a. Max Health should be 150, 200, or 250
b. Evasion and Crit should be two separate random values chosen from 5, 10, or
15%
c. Minimum Damage should be in the range 8-14, with Damage Range in the range
16-22
3. Display the names and stats of both fighters to the user, and inform them that the fight
will begin
4. Your gladiators will alternatingly attack each other using the appropriate member
functions (think about who is attacking, and who is taking *how much* damage)
a. Each attack should display info about damage and/or remaining health
b. This will continue until a gladiator loses all their health
5. Inform the user who was victorious. Ask if the user wants to run another fight (return to
step 2) or not (end program)

More products