chino.H
#ifndef _CHINO_H
#define _CHINO_H
#include "item.H"
#include <string>
using namespace std;
class ChinoInfo: public ItemInfo {
public:
ChinoInfo(double p, string c, int s, int i, bool cf);
int getSize();
int getInseam();
bool getCuffed();
void display();
private:
int size;
int inseam;
bool cuffed;
};
#endif /* _CHINO_H */
|
chino.cpp
#include "chino.H"
ChinoInfo::ChinoInfo(double p, string c, int s, int i, bool cf) :
ItemInfo(p, c) {
size = s;
inseam = i;
cuffed = cf;
}
int ChinoInfo::getSize() {
return size;
}
int ChinoInfo::getInseam() {
return inseam;
}
bool ChinoInfo::getCuffed() {
return cuffed;
}
void ChinoInfo::display() {
cout << "The pants' price is " << getPrice() << endl;
cout << "The pants' color is " << getColor() << endl;
cout << "The pants' waist size is " << size << endl;
cout << "The pants' inseam length is " << inseam << endl;
cout << "The pants are " <<
(cuffed ? "" : "not ") << "cuffed." << endl;
}
|