Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help with easy class instructions in C++ program C++ Data Structures create the character data type our base class): Design and implement an ADT
Please help with easy class instructions in C++ program
C++ Data Structures create the character data type our base class): Design and implement an ADT that represents a character in a game. As you read the instructions remember "client" refers to the client program using the ADT This ADT should have member variables that hold the following data: the character's name, the character's height, the character's weight, the character's tendency and the character's health. The tendency of a character is the goodness of a character and ranges from -1.0 (very bad) to 1.0 (very good) with 0.0 being neutral. The health of the character is represented as a percentage between 0.0 and 1.0 with 1.0 being 100% healthy. Your class should have one constructor-determine the parameters based on the information given next. Characters should begin with a neutral tendency and 100% health. The name, height and weight of the character should be initialized by the client program. Your class should have the following member methods heal: increases a character's health by a client-supplied percentage. b. injure: decreases a character's health by a client-supplied percentage. c takeAction: changes a character's tendency. The member function should take one parameter between 0.1 and 0.9 (positive or negative) to increase or decrease a character's tendency. Do not let the tendency be less than -1.0 or greater than 1.0 d. get and set methods for weight and height e. a get method for name (no set they can't change their name) f you should only have get methods for: health and tendency (these are changed only via other methods like heal etc) g. display Attributes: displays all information about the character: name, height, weight, tendency and healthStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started