-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
75 lines (72 loc) · 2.24 KB
/
main.cpp
File metadata and controls
75 lines (72 loc) · 2.24 KB
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
// FCAI – Programming 1 – 2022 - Assignment 4
// Program Name: TextEditor.cpp
// Last Modification Date: 15/5/2022
// Author1 and ID and Group: Rawan Hesham / 20211040 / S2
// Author2 and ID and Group: Nourhan Mahmoud / 20211107 / S2
// Author3 and ID and Group: Mariam Moutaz Mohamed Mounir /20210386/S2
// Teaching Assistant: Eg.Nesma and Eg.Yousra
// Purpose: program for displaying and manipulating text files.
#include "Text_Editor.h"
int main() {
int choice;
cout<< "1. Add new text to the end of the file.\n2. Display the content of the file.\n3. Empty the file.\n4. Encrypt the file content.\n5. Decrypt the file content.\n6. Merge another file.\n7. Count the number of words in the file.\n8. Count the number of characters in the file.\n9. Count the number of lines in the file.\n10. Search for a word in the file.\n11. Count the number of times a word exists in the file.\n12. Turn the file content to upper case.\n13. Turn the file content to lower case.\n14. Turn file content to 1st caps (1st char of each word is capital).\n15. Save.\n16. Exit.\n";
cout << "Please choose number: ";
cin >> choice;
switch (choice) {
case 1:
add_text();
save();
break;
case 2:
display_file();
save();
break;
case 3:
empty_file();
save();
break;
case 4:
encrypt();
save();
break;
case 5:
decrypt_file();
save();
break;
case 6:
mergeFiles();
save();
break;
case 7:
countWords();
break;
case 8:
countCharacters();
break;
case 9:
countLines();
break;
case 10:
searchForWord();
break;
case 11:
countNumTimesWord();
break;
case 12:
turnUpper();
save();
break;
case 13:
turnLower();
save();
break;
case 14:
firstCaps();
break;
case 15:
save();
break;
case 16:
break;
}
}