# How to get the integers 35 and 50 in the output of this program ?

I am really very new in C++ programming and its been only a month i started learning Object Oriented Programming and i was learning this program of inheritance and I am not getting the output i wanted. What is wrong in this source code below.

#include<iostream>
using namespace std;
class enemy{
private:
int attackpower;
public:
void enemys(int x)
{
attackpower=x;
}

};

class monster : public enemy
{
public:
enemy::enemys;

};

class ninja : public enemy
{
public:
enemy::enemys;
};

int main()
{
monster object1;
cout<<"You get points : - "<<endl;  object1.enemys( 35);

ninja object2;
cout<<"You get points  : - "<<endl; object2.enemys( 50);

}

well the output I get is this :

output : You get points : - You get points : -

I am suppose to get the integers i mentioned after "You get points : - 35 " and "You get points - 50"

as per the program I am not getting the integers in output. WHat could be wrong?

I am new to programming so please kindly help me.

Thanks a lot.

Here's some code that makes (very slight) use of inheritance. Maybe you'll find it useful

#include<iostream>
using namespace std;
class enemy{
private:
int attackpower;
public:
enemy(int ap)
{
attackpower = ap;
}
int get_attackpower()
{
return attackpower;
}

};

class monster : public enemy
{
public:
monster() : enemy(35)
{
}
};

class ninja : public enemy
{
public:
ninja() : enemy(50)
{
}
};

int main()
{
monster object1;
cout<<"You get points : - " << object1.get_attackpower() << endl;

ninja object2;
cout<<"You get points  : - "<< object2.get_attackpower() << endl;

}

output is

You get points : - 35
You get points  : - 50