help

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
http://www.catb.org/esr/faqs/smart-questions.html#bespecific
http://www.catb.org/esr/faqs/smart-questions.html#homework

> 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.


https://www.cplusplus.com/forum/beginner/270551/
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
enum class player_type { warrior, thief, wizard, healer };
class player
{
public:
  player(const string name, player_type type, int strength, int dexterity, int intelligence);
  void display();
private:
  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.