-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.cpp
More file actions
40 lines (34 loc) · 886 Bytes
/
menu.cpp
File metadata and controls
40 lines (34 loc) · 886 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
37
38
39
40
//
// Created by Nicolas Tsagarides on 4/11/15.
//
#include "menu.h"
#include "misc.h"
std::string menu()
{
std::string option = "";
bool firstTime = true;
while (option != "0" && option != "1" && option != "2" && option != "3" && option != "x" && option != "X")
{
if (!firstTime)
{
std::cout << "\nInvalid input";
}
showMenu();
option = userInput();
firstTime = false;
}
return (option);
}
void showMenu()
{
std::cout << std::endl <<
"Select an option from below:\n\n" <<
" 0: Manage point-set\n" <<
" --\n" <<
" 1: Graham Scan Algorithm\n" <<
" 2: Gift Wrapping Algorithm\n" <<
" 3: Divide and Conquer Algorithm\n" <<
" --\n" <<
" X: Exit\n\n" <<
"Option: ";
}