Question: 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

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!