Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

Why is overfitting a big problem in data analytics?

Answered: 1 week ago

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago