-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathProduct.h
32 lines (27 loc) · 882 Bytes
/
Product.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef _PRODUCT_H_
#define _PRODUCT_H_
#include <string>
using namespace std;
static unsigned int counter = 1;
class Product
{
private:
unsigned int productID;
double price;
string name;
string category;
unsigned int quantity;
//static unsigned int counter; // a counter for the productID
public:
Product(const string inName, const double inPrice, const string cat) :
productID(counter++), price(inPrice), name(inName), category(cat),
quantity(0) {}
void setQuantity(const int inQuantity) { quantity = inQuantity; }
int getQuantity() const { return quantity; }
string getCategory() const { return category; }
double getPrice() const { return price; }
int getID() const { return productID; }
string getName() const { return name; }
//void printInfo() = 0;
};
#endif