The following code illustrates how abstract classes are defined:
class BankAccount{
public:
virtual CalcBalance() = 0;
// Other public members go here
protected:
// Protected members go here
private:
// Private members go here
};
class CheckingAccount : public BankAccount{
public:
virtual CalcBalance() { // implement member function here }
// Other public members go here
protected:
// Protected members go here
private:
// Private members go here
};
class SavingsAccount : public BankAccount{
public:
virtual CalcBalance() { // implement member function here }
// Other public members go here
protected:
// Protected members go here
private:
// Private members go here
};