No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm having problems with the code below. I figured since Monster1=new Orc 's attack function can't know whether it's attacking a Troll or Goblin since it accepts an Entity pointer as an argument. But having the be_attacked functions doesn't help either #include<iostream> using namespace std; class Entity { public: virtual … | |
I'm having a problem with the code below. Can anyone help me? #include <iostream> #include <string> using namespace std; class Aircraft { public: Aircraft() : MPrice(0), LPrice(0), BPrice(0), PPrice(0), TotalPrice(0) , Stars(0) {cout<<"aircraft constructor"<<endl;} virtual ~Aircraft(){cout<<"aircraft destructor"<<endl;} protected: string Missile; string Laser; string Bomb; string Propulsion; int MPrice, LPrice, BPrice, … |