-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (37 loc) · 1012 Bytes
/
main.cpp
File metadata and controls
44 lines (37 loc) · 1012 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
42
43
#include "encrypt.h"
#include "decrypt.h"
#include <stdio.h>
void displayFunc()
{
printf("\n*----DISPLAY SECTION----*\n""1. WANT TO ENCODE MESSAGE\n""2. WANT TO DECODE MESSAGE\n""3. EXIT\n""CHOOSE (1-3)\n-->");
}
int main()
{
int choice;
char again;
do
{
displayFunc();
scanf("%d", &choice);
getchar(); // clear newline
switch (choice)
{
case 1:
sendermainFunc();
break;
case 2:
receiverfuncMain();
break;
case 3:
printf("EXITING PROGRAM..... :-}\n");
return 0;
default:
printf("INVALID CHOICE ! TRY AGAIN\n");
}
printf("\n*----DISPLAY SECTION----*\nDO YOU WANT TO USE ENIGMA AGAIN?\nY FOR YES\nN FOR NO\n-->");
scanf(" %c", &again);
getchar(); // clear newline
} while (again == 'Y' || again == 'y');
printf("GOODBYE ! :-}\n");
return 0;
}