Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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 health

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

ISBN: 3319712721, 978-3319712727

More Books

Students also viewed these Databases questions