Question: Every Creature has a Name, Category, Hitpoints, Level, and a boolean if the creature is Tame. The Creature class must define the following type INSIDE

Every Creature has a Name, Category, Hitpoints, Level, and a boolean if the creature is Tame.
The Creature class must define the following type INSIDE the class definition:
An enum named Category with values {UNKNOWN, UNDEAD, MYSTICAL, ALIEN}
The Creature class must have the following private member variables:
private:
- The name of the creature (a string in UPPERCASE)
- The category of the creature (an enum)
- The creature's hitpoints (an integer)
- The creature's level (an integer)
- A boolean flag indicating whether the creature is tame
The Creature class must have the following public member functions:
Constructors
/**
Default constructor.
Default-initializes all private members.
Default creature name: "NAMELESS".
Booleans are default-initialized to False.
Default enum value: UNKNOWN
Default Hitpoints and Level: 1.
*/
/**
Parameterized constructor.
@param : A reference to the name of the creature (a string). Set the creature's name to NAMELESS if the provided string contains non-alphabetic characters.
@param : The category of the creature (a Category enum) with default value UNKNOWN
@param : The creature's hitpoints (an integer), with default value 1 if not provided, or if the value provided is 0 or negative
@param : The creature's level (an integer), with default value 1 if not provided, or if the value provided is 0 or negative
@param : A flag indicating whether the creature is tame, with default value False
@post : The private members are set to the values of the corresponding parameters. The name is converted to UPPERCASE if it consists of alphabetical characters only, otherwise it is set to NAMELESS.
*/
Hint: Notice the default argument in the parameterized constructor.
Accessors (get) and Mutators (set)
/**

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!