// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <string>
#include <vector>

using namespace std;

class Substans
{
    private:
        double vol;
    public:
        Substans(double vol) { this->vol = vol; };
        double GetVol() { return vol; };
        virtual string GetNavn() = 0;
        virtual string GetSymbol() = 0;
};

class Vand : public Substans
{
    public:
    Vand(double vol) : Substans(vol) { };
    virtual string GetNavn() { return "Vand"; };
    virtual string GetSymbol() { return "H2O"; };
};

class Svovlsyre : public Substans
{
    public:
    Svovlsyre(double vol) : Substans(vol) { };
    virtual string GetNavn() { return "Svovlsyre"; };
    virtual string GetSymbol() { return "H2SO4"; };
};

int main()
{
    vector<Substans*> mix;
    mix.push_back(new Vand(0.5));
    mix.push_back(new Svovlsyre(0.5));
    for(int i = 0; i < mix.size(); i++) cout << mix[i]->GetNavn() << " " << mix[i]->GetSymbol() << " " << mix[i]->GetVol() << endl;
    return 0;
}
