-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
70 lines (64 loc) · 1.79 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include <fstream> //allows istream/ostream
#include <string>
#include <stdlib.h>
#include "Sorting.h"
using namespace std;
/*
Function Description:
Displays a menu on the terminal window. Have to incorporate with the main in order to actually run the functions.
Pre-conditions: Nothing needs to be passed in.
Post-conditions: Displays a menu so the user knows exactly what to input.
*/
void displayMenu()
{
cout << "======Main Menu======" << endl;
cout << "1. Initialize Array" << endl;
cout << "2. Apply Algorithms" << endl;
cout << "3. Display results" << endl;
cout << "4. Learn more" << endl; //we can use this to talk about the various algorithms and their complexities
cout << "5. Settings" << endl;
cout << "6. Quit" << endl;
return;
}
int main()
{
Sorting test = Sorting();
//get the users input
int input;
string title;
while(input != 6)
{
displayMenu();
cin >> input;
//clear out cin
cin.clear();
cin.ignore(10000,'\n');
switch (input)
{
case 1: //initialize array
test.initializeArray();
break;
case 2: //apply algorithms
test.runAlgorithms();
break;
case 3: //display results
break;
case 4: //learn more
test.moreInformation();
break;
case 5: // change the array settings
test.settings();
break;
case 6:
cout << "Goodbye!" << endl;
break;
default:
cout << "Invalid Input" << endl;
cin.clear();
cin.ignore(10000,'\n');
break;
}
}
return 0;
}