Question
Use c++ (define in header files and define in .cpp files) to complete the following specs: For Testing the code main.cpp #include #include #include SwapScramble.h
Use c++ (define in header files and define in .cpp files) to complete the following specs:
For Testing the code
main.cpp
#include #include #include "SwapScramble.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.
This file will be overwritten by the automarker if submitted. */
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."; SwapScramble ss; testCipher(ss, "program"); testCipher(ss, "world"); testCipher(ss, "secret"); testCipher(ss, "sad world"); testCipher(ss, " a "); testCipher(ss, shortText); testCipher(ss, longText);
return 0; }
output
MRRGOAP
PROGRAM
WLROD WORLD
TERCES SECRET
SLDOWRAD SADWORLD
The provided text is too short to be safely encrypted
TEPCESROT TOPSECRET
.CUOBDSNNTHLDRBYAAOLTTAETRNGWNLLOUPHERTFTHHPSRAPGORR)MIITGIAMGNA(ETTREUEYRETARTEHRYAIVARQUHS:FIPBOHROMDEE;EAPISEESTIRP.TEETCT,PNCHTBAIL.AATIAEUS,TDEEURLOTOTTAAMRKSSJO'GOTTGHESTAFGORTEOIEWUOESVKRMLIETEYGAEGPINBIIUEEUIMMCKHSNOHWLIEEUAYOE-NAEITGERNGIAASMH.TITUEBPSOOLTWELQFNNMUSEEUSAADTOVUHE'TOHUTYOSWTOREUOYOADWNNTMACEDONNLWFRSODAIYLUISEIPNEAROHTOTAITPMTREOCP:NHVASGRRBOLFTERWUEYTEEAOTP.TRRTSDEENXLYZR.NHLSAAEEOYCUDRRTTPROFREMATRAODONUTYUETAETCHTYYIUANQEHS:BSTNCZULLSYRNUIDIAAEENHIMAOMA,LSANTZRLTRNMTA.GURRASOTEETUILTTETGAEMHKESAORWHI,EGAUDNALNNAMNAPGORRLMETEATOOHORTEAPAEIOI'OWHN,TLSWYRAATOIGGIAROCTA ACCORDINGTOLARRYWALL,THEORIGINALAUTHOROFTHEPERLPROGRAMMINGLANGUAGE,THEREARETHREEGREATVIRTUESOFAPROGRAMMER;LAZINESS,IMPATIENCE,ANDHUBRIS.LAZINESS:THEQUALITYTHATMAKESYOUGOTOGREATEFFORTTOREDUCEOVERALLENERGYEXPENDITURE.ITMAKESYOUWRITELABOR-SAVINGPROGRAMSTHATOTHERPEOPLEWILLFINDUSEFULANDDOCUMENTWHATYOUWROTESOYOUDON'THAVETOANSWERSOMANYQUESTIONSABOUTIT.IMPATIENCE:THEANGERYOUFEELWHENTHECOMPUTERISBEINGLAZY.THISMAKESYOUWRITEPROGRAMSTHATDON'TJUSTREACTTOYOURNEEDS,BUTACTUALLYANTICIPATETHEM.ORATLEASTPRETENDTO.HUBRIS:THEQUALITYTHATMAKESYOUWRITE(ANDMAINTAIN)PROGRAMSTHATOTHERPEOPLEWON'TWANTTOSAYBADTHINGSABOUT.
The relationships between the classes are depicted in the UML below: TranspoaitonClpher SwapScrambdeStep 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