-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProduct.h
More file actions
36 lines (28 loc) · 812 Bytes
/
Product.h
File metadata and controls
36 lines (28 loc) · 812 Bytes
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
33
34
35
36
// Tyeon Ford
#ifndef PRODUCT_H
#define PRODUCT_H
#include <string>
using namespace std;
// Abstract base class for all products
class Product {
protected:
string name;
string description;
double price;
int stock;
public:
Product(string name, double price, int stock, string description);
virtual ~Product() = default;
// Pure virtual function - makes this an abstract class
virtual void displayDetails() const = 0;
// getters
string getName() const;
double getPrice() const;
int getStock() const;
string getDescription() const;
// Stock management area
bool reduceStock(int quantity);
void restoreStock(int quantity);
bool isInStock() const;
};
#endif