Click here to Skip to main content
15,920,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGetting the attributes of special items Pin
Atom23-Apr-06 9:45
Atom23-Apr-06 9:45 
AnswerRe: Getting the attributes of special items Pin
YaronNir23-Apr-06 22:13
YaronNir23-Apr-06 22:13 
QuestionShell Extension for application starting Pin
Samsung23-Apr-06 8:39
Samsung23-Apr-06 8:39 
AnswerRe: Shell Extension for application starting Pin
Michael Dunn23-Apr-06 17:04
sitebuilderMichael Dunn23-Apr-06 17:04 
QuestionReturn from CFrameView Create shuts down app Pin
Christopher J. Noyes23-Apr-06 6:27
Christopher J. Noyes23-Apr-06 6:27 
QuestionInheritance Pin
William Burton23-Apr-06 6:01
William Burton23-Apr-06 6:01 
AnswerRe: Inheritance Pin
Nemanja Trifunovic23-Apr-06 6:50
Nemanja Trifunovic23-Apr-06 6:50 
QuestionRe: Inheritance Pin
William Burton23-Apr-06 7:19
William Burton23-Apr-06 7:19 
so when i assign a sub to the variable of type Vessel its still holding it as a sub but just cant see the functions / data?

-- modified at 13:31 Sunday 23rd April, 2006

heres the vessel class so how could i impliment the pure functions in them because vessel would have to be totally abstract would it not?

Cheers

#ifndef VESSEL_H
#define VESSEL_H

#include <string>
#include "afxwin.h"
using namespace std;
class Vessel
{
protected:
int _prKey;
int _maxSpeed;
CString _name;
int _length;
int _maxRange;
int _maxDisplacement;
int _crewAmount;
CString _vesselType;
public:
int getKey();
void setKey(int pKey);
int getSpeed();
void setSpeed(int pSpeed);
CString getName();
void setName(CString pName);
int getLength();
void setLength(int pLength);
int getRange();
void setRange(int pRange);
int getDisplacement();
void setDisplacement(int pDisplacement);
int getCrew();
void setCrew(int pCrew);
CString getType();
void setType(CString pType);
};

class SurfaceVessel : public Vessel
{
protected:
int _helicopters;
public:
int getHeli();
void setHeli(int pHeli);
};
class AircraftCarrier : public SurfaceVessel
{
int _aircraft;
public:
int getAircraft();
void setAircraft(int pAircraft);
};

class Destroyer : public SurfaceVessel
{
bool _gunSystem;
bool _guidedMissileSystem;
public:
bool getGunSystem();
bool getGuidedSystem();
void setGunSystem(bool pGunSystem);
void setGuidedSystem(bool pGuidedSystem);
};

class FleetAux : public SurfaceVessel
{
protected:
int _deckSpace;
public:
int getDeckSpace();
void setDeckSpace(int pDeckSpace);
};

class Submarine : public Vessel
{
protected:
int _maxDiveDepth;
int _maxSubmergedSpeed;
int _displacementSubmerged;
public:
int getMaxDiveDepth();
int getSubSpeed();
int getDisplacementSub();
void setMaxDiveDepth(int pMDD);
void setSubSpeed(int pSubSpeed);
void setDisplacementSub(int pDisSub);
};

class SSB : public Submarine
{
int _slbms;
public:
int getSLBMS();
void setSLBMS(int pSLBMS);
};

class SSK : public Submarine
{
int _torpedoes;
public:
int getTorps();
void setTorps(int pTorps);
};

class Tanker : public FleetAux
{
int _storageCapacity; //Litres
public:
int getStorCap();
void setStorCap(int pStorCap);
};
class LandingPlat : public FleetAux
{
int _storageCapacity; // M^3
int _aircraftLand;
public:
int getStorCap();
void setStorCap(int pStorCap);
int getAircraftLand();
void setAircraftLand(int pAirAmount);
};
#endif

-- modified at 13:56 Sunday 23rd April, 2006
AnswerRe: Inheritance Pin
John R. Shaw23-Apr-06 11:54
John R. Shaw23-Apr-06 11:54 
QuestionRe: Inheritance Pin
William Burton23-Apr-06 12:17
William Burton23-Apr-06 12:17 
AnswerRe: Inheritance Pin
Stephen Hewitt23-Apr-06 13:46
Stephen Hewitt23-Apr-06 13:46 
QuestionRe: Inheritance Pin
William Burton23-Apr-06 15:16
William Burton23-Apr-06 15:16 
AnswerRe: Inheritance Pin
Stephen Hewitt23-Apr-06 16:09
Stephen Hewitt23-Apr-06 16:09 
QuestionRe: Inheritance Pin
William Burton24-Apr-06 0:18
William Burton24-Apr-06 0:18 
AnswerRe: Inheritance Pin
Stephen Hewitt24-Apr-06 1:38
Stephen Hewitt24-Apr-06 1:38 
GeneralRe: Inheritance Pin
David Crow24-Apr-06 2:59
David Crow24-Apr-06 2:59 
GeneralRe: Inheritance Pin
John R. Shaw29-Apr-06 20:29
John R. Shaw29-Apr-06 20:29 
GeneralRe: Inheritance Pin
David Crow1-May-06 2:51
David Crow1-May-06 2:51 
QuestionPrinter Font Question Pin
JKJKJK23-Apr-06 4:53
JKJKJK23-Apr-06 4:53 
AnswerRe: Printer Font Question Pin
Blake Miller26-Apr-06 7:46
Blake Miller26-Apr-06 7:46 
Questionhow can i pass a password to a shellexecute() to extract a zip file from my VC++6.0 program Pin
lekshmipriya23-Apr-06 2:49
lekshmipriya23-Apr-06 2:49 
AnswerRe: how can i pass a password to a shellexecute() to extract a zip file from my VC++6.0 program Pin
YaronNir23-Apr-06 3:33
YaronNir23-Apr-06 3:33 
QuestionRe: how can i pass a password to a shellexecute() to extract a zip file from my VC++6.0 program Pin
lekshmipriya23-Apr-06 4:00
lekshmipriya23-Apr-06 4:00 
AnswerRe: how can i pass a password to a shellexecute() to extract a zip file from my VC++6.0 program Pin
YaronNir23-Apr-06 4:09
YaronNir23-Apr-06 4:09 
QuestionRe: how can i pass a password to a shellexecute() to extract a zip file from my VC++6.0 program Pin
lekshmipriya23-Apr-06 5:55
lekshmipriya23-Apr-06 5:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.