-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cpp
104 lines (90 loc) · 2.25 KB
/
setup.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* setup.cpp
*/
#include "./includes/globalSequenceAlignment.h"
#include "./includes/strassen.h"
#include "./includes/pgcb.h"
#include "./includes/lcs.h"
#include "./includes/tsp.h"
#include "./includes/setup.h"
int main()
{
// welcome menu
cout << " \t\tINFO4017 INF DEPTINF UYI " << endl;
cout << " WELCOME TO OUR CLEAR STRUCTURE CODE " << endl;
cout << " GO " << endl;
MainActionOption();
return 0;
}
bool MainTryParse(string &input, int &output)
{
try
{
output = stoi(input);
}
catch (invalid_argument)
{
return false;
}
return (output >= 0 && output < 6);
}
void MainActionMenu()
{
cout << "\n\n HIT THE NUMBER BEHIND THE ACTION TO LAUNCH " << endl;
cout << " 1) STRASSEN " << endl;
cout << " 2) LCS " << endl;
cout << " 3) SEQUENCE GLOBAL ALIGNMENT " << endl;
cout << " 4) PGCB " << endl;
cout << " 5) TSP USING SA " << endl;
cout << " 0) EXIT " << endl;
}
void MainActionOption()
{
int option = -1;
string action;
do
{
// always show action option to users
MainActionMenu();
// get users option from command line
// gettng path
do
{
cout << "\n CHOOSE YOUR ACTION " << endl;
action = getInputUser();
// cout << tryParse(action, option) << option << endl;
} while (MainTryParse(action, option) == false);
// custom action for each action choose
switch (option)
{
case 0:
// Exiting message
cout << " THANKS FOR YOUR RELIABILITY AND GOOD BYE " << endl;
break;
case 1:
// code load strassen
StrassenLauncher();
break;
case 2:
// code load lcs
LCSLauncher();
break;
case 3:
// code load gsa
GSALauncher();
break;
case 4:
// code load pgcb
PGCBLauncher();
break;
case 5:
// code load pgcb
TSPLauncher();
break;
default:
// code default
break;
}
} while (option != 0);
// Exiting message
}