Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Caesar Cipher in C++ Your task is write a cpp file that implements the methods from the header file. You are not permitted to make

Caesar Cipher in C++

Your task is write a cpp file that implements the methods from the header file. You are not permitted to make any changes to the header file at all. You should also write a test cpp file that creates a Caesar object and uses the encrypt, decrypt and destructor methods. The test file should demonstrate that the Caesar object works correctly.

ceaser.h

// include file for Caesar cipher code

#ifndef CAESAR_H

#define CAESAR_H

#include

class Caesar {

private:

//pointers used to refer to the standard alphabet array and the Caesar shift array

char* std_alphabet;

char* c_alphabet;

public:

// The constructor . . .

// create the two arrays with the c_alphabet array contents representing the std_alphabet

// characters shifted by a value of the shift parameter

Caesar(int shift = 0);

// encrypt a message. Returns count of characters processed

// first string is message, second is encrypted string

int encrypt(const std::string& message, std::string& emessage);

// decrypt a message. Returns count of characters processed

// first string is encrypted string, second is decrypted string

int decrypt(const std::string& message, std::string& dmessage);

//delete any memory resources used by the class

~Caesar();

}; // end of class . . .

#endif

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

=+1 What would you do if you were the IHR manager?

Answered: 1 week ago