/*
 * exampleStep4Inheritance.cpp
 * 
 * Author: Deborah R. Fowler
 * Date: Oct 19, 2019
 * 
 * Simple example to show inhertitance
 */


#include <iostream>
#include <string>
using namespace std;

class Phone
{
    public:
        string provider;
        void communicate();
        Phone();
        ~Phone();
};

Phone::Phone()
{
    cout << "\nA phone has been created!";
}

Phone::~Phone()
{
    cout << "\nHang up";
    
}

void Phone::communicate()
{
    cout << "\nTalk, talk, talk";
};

class Mobile: public Phone
{
    public:
        int batterylife;
        void charge();
};

void Mobile::charge()
{
    cout << "\nCharging phone";
}

class Landline: public Phone
{
    public:
        string location;
};



int main()
{
        Phone *pPhone = new Phone;
        
        delete(pPhone);
}


