Hmz. You want to split those classes up in files perhaps. Do you know how to do so? If you do, please do. It clears up the structure of your program a lot (and saves compiling time, yeey). But it's not necessary of course.
Oh, and normally people code classes like this..
class monkey {
public:
protected:
private:
};
In that order, functions first, variables last. But again no biggy.
You seem to have an aweful lot of constructors:
Gun::Gun()
{
shotsFired = 0;
hit = 0;
miss = 0;
hitPercent = 0.0;
name = " ";
ammo = 0;
}
Gun::Gun(int rounds)
{
if (rounds >= 0) {
ammo = rounds;
}
}
void Gun::Gun(int, double)
{
cout << "Shots: " << shotsFired << endl;
cout << "Hit %: " << hitPercent << endl;
}
And some double functions...
void Gun::shoot(int ammo, double hitPercent, int hit, int miss, int shotsFired)
{
ammo--;
shotsFired = hit + miss;
hitPercent = hit / shotsFired;
miss = shotsFired - hit;
}
void Gun::shoot(int, double, int, int, int)
My first suggestion is to clean the code up a bit, it'll make it a lot more readable and doesn't take very long.
Are you stuck on anything?