-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (38 loc) · 767 Bytes
/
Copy pathmain.cpp
File metadata and controls
41 lines (38 loc) · 767 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
41
#include "extenders.h"
using namespace std;
int menu(string options[], int len)
{
for (int i = 0; i < len; i++)
{
cout << "[" << i << "]: "+options[i] << endl;
}
cout << endl << "Chose an option. Enter the number of the option: ";
string x;
cin >> x;
int pick = stoi(x);
if (pick < len && !(pick < 0)) return pick; else
{
cout << "Invalid option! Option 0 picked instead." << endl << endl;
return 0;
}
}
int main()
{
string x;
cout << "Enter a Number: ";
cin >> x;
cout << endl << "Choose method to extend number." << endl;
string options[2] = {"Stub", "JJexe"};
int picked = menu(options, 2);
switch (picked)
{
case 0:
stub_ExtendedNumber(x);
break;
case 1:
jjexe_ExtendedNumber(x);
break;
}
cout << endl;
return 0;
}