I'm doing a part to a project where I'm making a weapon class and a test program. The weapon class has to have three private data members: two integers (hit_chance and stamina_required) and a string for the weapon type. There is suppossed to be two public member functions: a display function which prints out the private data members. My teacher wants us to split the Weapon class into Weapon.h and Weapon.cpp and to put the main() function in another file named assignment10.cpp
Then I'm writing a makefile to build the program.
Heres what I have for the Weapon.h:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1 #include<string>
2 usingnamespace std;
3
4
5 class Weapon {
6 private:
7 int hit_chance;
8 int stamina_required;
9 string weapon;
10
11
12 public:
13 void display(void);
14 Weapon(string weapon, int hit, int stamina);
15
16 };
17
~
I can't get these to compile correctly and Ive been working on them for a really long time. Any idea's on what the errors in my code are and how I can fix them?