-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaesarRun.cpp
More file actions
33 lines (28 loc) · 1.01 KB
/
CaesarRun.cpp
File metadata and controls
33 lines (28 loc) · 1.01 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
// Winter Thomas and Ricardo Romanach
#include <iostream>
#include <string>
#include "Caesar.h"
#include "DataManipulation.h"
int main(){
int userInput;
int numberOfResults = 5;
std::cout << "\nWould you like to encrypt or decrypt?\n";
std::cout << "1. Encrypt\n";
std::cout << "2. Decrypt\n";
userInput = DataManipulation::getIntegerInput(1, 2);
if (userInput == 1){
std::string encryptedText = Caesar::encrypt();
std::cout << "\n" << encryptedText;
std::cout << "\n\nWould you like to write the text to a file? Y/[N]\n";
userInput = DataManipulation::getLetterInput();
if (userInput == 'Y'){
std::string fileName;
std::cout << "\nWhat file would you like to output to?\n> ";
getline(std::cin, fileName);
DataManipulation::writeStringToFile(fileName, encryptedText);
}
}
else {
Caesar::solveCaesar(DataManipulation::getUserInput("Please enter a ciphertext:"), numberOfResults);
}
}