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:

Use c++ (define in header files and define in .cpp files) tocomplete the following specs: For Testing the code main.cpp #include #include #include"SwapScramble.h" using namespace std; /* The following main tests the functionality ofvarious ciphers. Use at your own discretion, and feel free to extendand/or modify in any way. This file will be overwritten by theautomarker 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

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 SwapScrambde

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!