-
Notifications
You must be signed in to change notification settings - Fork 2
/
helpers.hpp
executable file
·66 lines (54 loc) · 1.34 KB
/
helpers.hpp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/** Contains function and class declarations for main.cpp
*
* The implementations for these functions and classes are present in
* `helpers.cpp`
*
* Author: Mohit Sakhuja
*/
#ifndef HELPERS_HPP
#define HELPERS_HPP
#include <iostream>
#include <vector>
#define VIEW_CART 1000
#define CHECKOUT 2000
#define QUIT 5000
using namespace std;
class Order;
class Item
{
public:
// Data members
unsigned int id;
string name;
float cost;
unsigned int quantity;
unsigned int max_quantity;
float net_cost;
// Member functions
Item(unsigned int id, string name, float cost, unsigned int quantity, unsigned int max_quantity);
void operator = (Item &item);
};
class Order
{
public:
// Data members
unsigned int id;
string customer_name;
float bill;
vector<Item> items;
// Member functions
Order(string customer_name = "Customer");
~Order(void);
void show_menu(void) const;
void change_quantity(unsigned int item_id);
void produce_bill(void) throw (int);
void calculate_bill(void);
void view_cart(void);
};
void clear_screen(void);
void greet(void);
void get_customer_name(void);
void invalid_option(void);
void save_and_quit(void) throw (int);
extern Order order;
#endif