-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
51 lines (41 loc) · 1.16 KB
/
main.cpp
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
#include "headerFiles/addOrder.h"
#include "headerFiles/viewOrder.h"
#include "headerFiles/updateOrder.h"
#include <cctype>
#include <cstddef>
#include <ios>
#include <iostream>
#include <limits>
#include <sqlite3.h>
#include <string>
int main(int argc, char *argv[]) {
char userChoice = 'n';
bool running = true;
std::string customerName, customerItem;
int itemQuantity = 0;
do {
std::cout << "[A]dd Order\n[V]iew Order\n[U]pdate Order\n[E]xit\nEnter : ";
std::cin >> userChoice;
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
userChoice = std::toupper(userChoice);
switch (userChoice) {
case 'A':
AddOrder(customerName, customerItem, itemQuantity);
break;
case 'V':
ViewOrder();
break;
case 'U':
UpdateOrder();
break;
case 'E':
running = false;
break;
default:
std::cout << "Invalid Choice.\n";
break;
}
} while (running);
return 0;
}