-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
77 lines (71 loc) · 2 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
71
72
73
74
75
76
77
/****************************************************************************************** * *
* This Project is done for Tribhuwan University, IOE : Purwanchal Campus, Dharan *
* By : *
* 1. Sangharsha Dahal *
* 2. Samin Gaire *
* 3. Mandip Rajak *
* 4. Amit Poudel * *
******************************************************************************************/
#include <iostream>
#include "Dictionary.h"
using namespace std;
// Main function
int main() {
Dictionary dict;
string w;
int choice;
// Home Screen
do {
cout<<"\n\n\t********* DICTIONARY *********"<<endl;
cout << "\n\n\t\t**MAIN MENU**\n";
cout << "\n\t\t1. Search Word";
cout << "\n\t\t2. Read Fav";
cout << "\n\t\t3. Write Fav";
cout << "\n\t\t4. Read History";
cout << "\n\t\t5. Assistant Mode";
cout << "\n\t\t6. Exit";
cout<<"\n\n\n\t******************************"<<endl;
cout << "\nEnter your choice (1-6) : ";
cin >> choice;
switch (choice) {
case 1:
cout << "Enter a word to search: ";
cin >> w;
cout<<"\n";
// calling method to search the word
dict.findWord(w);
// writing into history file immediately
dict.setHistory(w);
break;
case 2:
// calling method to read fav file
dict.getFav();
break;
case 3:
// if user wants he/she can write a word
// just searched into fav file
dict.setFav();
break;
case 4:
// invoking method to read history file
dict.getHistory();
break;
case 5:
// writing current meaning into ttsData file
dict.ttsWrite();
// invoking method to read ttsData file
dict.ttsRead();
// clearing TTS data after read
dict.ttsDataClear();
break;
case 6:
exit(0);
break;
default:
cout << "\n....Invalid Choice....\nTry Again !!!\n";
exit(0);
break;
}
} while (choice != 6);
return 0;
}