Question
Using C++, implement(in header files) and define(in .cpp files) the following classes. Use the following test file to test your code. main.cpp #include #include #include
Using C++, implement(in header files) and define(in .cpp files) the following classes.
Use the following test file to test your code.
main.cpp
#include
#include "Vigenere.h"
using namespace std; /* The following main tests the functionality of various ciphers.
Use at your own discretion, and feel free to extend and/or modify in any way. */
void testCipher(Cipher& cipher, const string& text) { try { string encoded = cipher.encode(text); cout
int main() { string shortText="Top Secret";
string longText="According to Larry Wall, the original author of the Perl programming language, there are three great virtues of a programmer; Laziness, Impatience, and Hubris. Laziness: The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don't have to answer so many questions about it. Impatience: The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least pretend to. Hubris: The quality that makes you write (and maintain) programs that other people won't want to say bad things about."; Vigenere vig("BANANA"); testCipher(vig, shortText); testCipher(vig, longText); try { vig.setCodeword("?"); } catch(Exception e) { cout
testCipher(vig, shortText); testCipher(vig, longText); try { vig.setCodeword("this-is-not-a-code-you're-looking-for"); } catch(Exception e) { cout
testCipher(vig, shortText); testCipher(vig, longText);
return 0; }
Expected Output should be:
v1?A"'&446 Top Secret
c%21A&,06AC1Bm04A;Bx0.;MB67'N15+6+=#/A07C*24N15A7*4A~'5.N2A1*40/)A#0/44iAn#I+='65ZAw/3#C+40&'ZA00'Av714,5\Az#=+='B5\A#*4A470.86
The codeword provided is not going to generate a safe encryption
The codeword provided is not going to generate a safe encryption
AU^oBRI`Uc Top Secret
.IQ_aQO\WnaUm IXZs`OW Td Top Secret 6LMc N]{Voi|aYEbW_-QQbs~e"UUo[\XOvUQ_tJ_huYf-^Vt"Jrc@JXyy`hvZXnZ]YZQnTnUWhVPO -^ aUtnTrcdMXr_o]yXG"lfY^^dM!f_YtJid Y[ P]brTHc
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started