-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
28 lines (23 loc) · 1.02 KB
/
Main.cpp
File metadata and controls
28 lines (23 loc) · 1.02 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
/******************************************************************************
This is the control file for the Morse_Coder class. It creates a Morse_Coder
object, then uses it to encode a plaintext message and decode a cipertext
message. A message must be a string consisting of a single word.
******************************************************************************/
#include <iostream>
#include <fstream>
#include <string>
#include "Morse_Coder.h"
using namespace std;
int main() {
string plaintext_in, plaintext_out, ciphertext_in, ciphertext_out;
plaintext_in = "CS";
ciphertext_in = ". . . ";
Morse_Coder session = Morse_Coder();
ciphertext_out = session.encode_to_code(plaintext_in);
plaintext_out = session.decode_to_text(ciphertext_in);
cout << endl;
cout << "Morse code for " << '"' << plaintext_in << '"' << " is: " << ciphertext_out << endl << endl;
cout << "The plain text for " << '"' << ciphertext_in << '"' << " is: " << plaintext_out << endl << endl;
system("pause");
return 0;
}