reate a multi-class program, where one class will actually
reference another. This one will be a simple replica of a RPG-style character. In this program, you
will be able design a class to represent your character and will also design a class to represent
items you could pick up. The class attributes are:
 Player
o Name
o Type (warrior, thief, wizard, healer)
o Health
o Strength
o Dexterity
o Intelligence
 Item
o Name
o Type (weapon, magical, treasure)
o Points_Modifier (how much it affects health, strength, etc.)
Create functions for the classes as appropriate. For example, the Player class will have (at a
minimum) a constructor and a displayPlayer function (that returns a formatted string with the
Player’s details).
We will continue this next week by integrating the two classes with each other and in a main game class

im having trouble understanding what to do here..

Which piece in particular you haven't understood?

You have to code two classes. One which represents a player, and an other that represents an item. Add all required functions to them. I guess, the referencing to each other will get at in the next lesson.
Last edited on

> We will continue this next week by integrating the two classes with each other and in a main game class
I suggest further study of last week's assignment then, to make sure you actually understand it.
Then work your ass off for this weeks assignment (more than just copy/pasting it to a forum).

Otherwise, next weeks' assignment will be lost to you and you'll be forever behind the curve.
As opposed to say just phoning it in and pretending you didn't ask a question.

Maintaining your grade for one more week is not the same as knowledge.
You desire the latter, and you're not getting it.

Use this as a starting point:
enum class player_type { warrior, thief, wizard, healer };
class player
  player(const string name, player_type type, int strength, int dexterity, int intelligence);
  void display();
  string name;
  player_type type;
  int strength;
  int dexterity;
  int intelligence;

Now you need to implement the constructor and the display function.
Topic archived. No new replies allowed.