//----------------------------------------------------------------------
//  IMPLEMENTATION FILE (fountpen.cpp)
//  This module exports a FountPen class (derived from the Pen class).
//----------------------------------------------------------------------
#include "fountpen.h"
#include <iostream.h>

// Additional private members of FountPen class:
//    FillType fType;

FountPen::FountPen( /* in */ const char* description,
                    /* in */ int         stockNumber,
                    /* in */ int         initQuantity,
                    /* in */ float       initPrice,
                    /* in */ Color       penColor,
                    /* in */ Color       inkColor,
                    /* in */ FillType    fillType     )
    : Pen(description, stockNumber, initQuantity,
          initPrice, penColor, inkColor)
    //..................................................................
    // PRE:  All parameters assigned
    // POST: New object created via implicit call to base class
    //       constructor (passing the 6 required parameters to
    //       that constructor)
    //    && fType == fillType
    //..................................................................
{
    fType = fillType;
}

FountPen::FountPen( const FountPen& otherPen ) : Pen(otherPen)
    //..................................................................
    // POST: New object created via implicit call to base class
    //       copy-constructor (passing otherPen as a parameter to
    //       base class's copy-constructor)
    //    && fType == otherPen.fType
    //..................................................................
{
    fType = otherPen.fType;
}

FountPen::~FountPen()
    //..................................................................
    // POST: Object destroyed via implicit call to
    //       base class destructor
    //..................................................................
{
    // Nothing to do before base class destructor called
}

void FountPen::Display() const
    //..................................................................
    // POST: After base class's version of Display() invoked,
    //       fill type has been written to standard output
    //..................................................................
{
    Pen::Display();
    if (fType == cartridge)
        cout << "     Uses cartridges\n";
    else
        cout << "     Direct fill\n";
}


