-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
70 lines (64 loc) · 1.24 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 "nameDictionary.h"
int main()
{
std::string inputparam; //Variable will store user input
welcomeScreen();
populateDictionary();
do
{std::cout<<"\n"<<"Press a key to continue...\n\n\n";}
while(std::cin.get() != '\n');
instructions();
/*2*/
/*1*/
while(true)
{
std::getline(std::cin,inputparam);
if(inputparam==":q")
{return 0;}
else if(inputparam==":man")
{std::cout<<"\n";
instructions();}
else if(inputparam==":sname")
{
std::string input;
while(input != ":menu")
{
std::cout<<"\nEnter :menu to go to main menu\n";
std::cout<<"\nEnter name:\n";
std::getline(std::cin,input);
std::cout<<searchDictionary(input)<<"\n\n";
}
instructions();
}
else if(inputparam==":ename")
{std::cout<<manipulateDictionary();}
else
{
std::cout<<"Error\n";
return 0;
}
}
return 0;
}
/*2
//TODO Find bug in code below
//Breaks reading Segmentation fault (core dumped)
/*while(true)
{
std::getline(std::cin,inputparam);
if(inputparam==":q")
break;
else
{
manipulateDictionary(inputparam);
std::cout<<"\n";
}
}*/
/*1
while(searchparam!=":q"){
std::cout<<"Enter a name\n";
if(inputparam==":edit")
{
}
std::cout<<"\n"<<searchDictionary(inputparam)<<"\n\n\n";}
*/