-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCashier.h
84 lines (75 loc) · 1.67 KB
/
Cashier.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
///////////////////////////////////////////////////////////
// Cashier.h
// Implementation of the Class Cashier
// Author: Robert T
///////////////////////////////////////////////////////////
// Pseudocode:
// class Cashier : public Inventory
// - purchased_books: string ** ;
// - purchased_books_row: int =0;
// - book_isbn: char;
// - book_title: char;
// - book_qty: int;
// - book_price: double;
// - book_total: int;
// - subtotal: double;
// - taxRate: const double = 0.0875;
// - tax: double;
// - total: int;
// - char date_ordered: char;
// Accessors
// + Cashier();
// + virtual ~Cashier();
// + menu(): void;
// + purchaseBooks(): void;
// + displayShopppingCart(): void;
// Mutators
// + addBookToCart(string isbn, string quantity): void;
// + placeOrder(): void;
// + deleteMemory(): void;
// Template
// T calculateTax(T subtotal);
// Exception
// class InvalidSubtotal{};
// Friend function
// friend int main();
#ifndef _CRT_SECURE_NO_WARNING_CASHIER
#define _CRT_SECURE_NO_WARNING_CASHIER
#include "Inventory.h"
class Cashier : public Inventory
{
private:
string **purchased_books;
int purchased_books_row = 0;
char book_isbn;
char book_title;
int book_qty;
double book_price;
int book_total;
double subtotal;
const double taxRate = 0.0875;
double tax;
int total;
char date_ordered;
public:
Cashier();
virtual ~Cashier();
// Accessors
void menu();
void purchaseBooks();
void displayShopppingCart();
// Template
template <class T>
T calculateTax(T subtotal);
// Exception
class InvalidSubtotal
{
};
// Friend function
friend int main();
// Mutators
bool addBookToCart(string isbn, string quantity);
bool placeOrder();
void deleteMemory();
};
#endif