-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrocery.h
46 lines (41 loc) · 1.27 KB
/
grocery.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
using namespace std;
class GroceryItem{
friend ostream& operator<<(ostream& o, const GroceryItem& g);
private:
string name;
string description;
double price;
int quantity;
int ID;
public:
GroceryItem();
GroceryItem(int ID, string name, string description, double price, int quantity);
GroceryItem(string name, string description, double price, int quantity);
string getName() const;
string getDescription() const;
double getPrice() const;
int getQuantity() const;
int getID() const;
void setName(string name);
void setDescription(string description);
void setPrice(double price);
void setQuantity(int quantity);
void setID(int ID);
};
class GroceryList{
friend ostream& operator<<(ostream& o, const GroceryList& g);
private:
GroceryItem* grocery;
int size, capacity;
void resize();
public:
GroceryList();
GroceryList(const GroceryList& g);
GroceryList& operator=(const GroceryList& g);
~GroceryList();
void Create(const GroceryItem& g);
GroceryItem Read() const;
void Update(int ID);
void Delete(int ID);
};