// file: part.cc
// Implementation file for the Part class.

#include "part.h"

Part :: Part(){
   id = 0;
   quantity = 0;
   cost = 0.00;
}

Part :: Part( int i, int q,float c ) {
   id = i;
   quantity = q;
   cost = c;
}

ostream& operator << ( ostream& Out, const Part& x ) {
   Out << x.id << '\t' << x.quantity << '\t'
        << x.cost << endl;
   return Out;
}


istream& operator >> ( istream& In, Part& x ) {
   In >> x.id;
   In >> x.quantity;
   In >> x.cost;
   return In;
}

int Part :: GetQuantity()const{
   return quantity;
}

float Part :: GetCost()const{
   return cost;
}

void Part :: ChangeQuantity( int q ) {
   quantity = q;
}

void Part :: ChangeCost( float c ) {
   cost = c;
}

bool Part :: operator > ( const Part& y ) const {
   return (id > y.id);
}
