In Progress

a C++ program that implements a few common operations that involve a simple cipher engine – primarily addition, keys_transfer, assignment and printing to the standard output.

Following up the partA and partB of this project, the code of project 1

need to implement operator overload and error handling. The header file has been slight modified

accordingly. The memory of private data string need to be dynamic allocated.

In part B, LCR has been introduced to encrypt the data string. In order to decrypt the data string,

modulus inverse method is often used. (refer to

[url removed, login to view] ). A simple method such as

extensive search can easily solve the inversion. For example: if when the encryption ‘f’ is

ciphered to ‘c’. During decryption, the code can simply scan from ‘a’ all the way to ‘space’ and

check which one can be encrypted to ‘c’ by using the same keys values.

The header file has been provide as below:

// File name: LCR_Ciper.h

// Description: Header file for LCR

// Date: 2/14/2017


#include <iostream>

#include <iomanip>

#include <stdlib.h>

#include <fstream>

using namespace std;

class LCR_cipher


Spring 2017


// overload operator<< to print context to console

friend ostream& operator<<(ostream& out, LCR_cipher& m);


// Constructor: allocate memory to save context and keys

LCR_cipher(char *context_string, char *keys_string);

// Copy constructor:

LCR_cipher(const LCR_cipher& other);

// Destructor: deallocate memory that was allocated dynamically


//check whether *keys string has valid LCR encryption value

bool iskeysOK();

//check whether the context string is encrypted or not

bool isencrypted();

//Retrieve CLR encryption value from *keys string

void getkeys(int& a, int& c);

// output the *context to console

void output_context();

//using operator ++ to encrypt context string

LCR_cipher& operator++();

//using operator -- to unencrypt context string

LCR_cipher& operator--();

//Assignment operator overload

LCR_cipher& operator=(const LCR_cipher& other);

…… all the other operators…..


char *context; //array to store context string

char *keys; //array to store encryption keys

bool encrypted; //whether string in *context is encrypted or not

}; // End class

// End header file

For this project, you should overload the following night operators:




++ Using keys to encrypt the context

-- Using keys to decrypt the context

= For A=B, instance A will have same context and keys as instance B

< For A<B, instance A will get keys from instance B

+ If two instances have same keys values, the context of A and B can be concatenate



If two instances have same keys values, concatenate the context of A and B and assign

to a third instance

== Test if the unencrypted context of A and B are same or not

!= Test if the unencrypted context of A and B are different or not

<< Output the context to console

Exception handling: Your implementation should use try, throw, and catch to handle

exceptions. (See C++ Interlude 3 in the textbook.) At a minimum, your code should take care of

the following three cases:

1. Trying to create LCR_cipher object without valid context and keys, such as empty string.

2. If new returns NULL when allocating memory for data.

3. If the program attempts to add two instance with different keys.

File naming conventions: The name of your header (“specification”) file must be exactly

LCR_cipher.h, and the name of your source (“implementation”) file must be exactly

LCR_cipher.cpp. This latter file must contain your implementation of the ADT. Separate

client files will be posted in Canvas, for use in testing your code. These client files will have

names similar to [url removed, login to view], [url removed, login to view], etc., and each of these will contain a main()


Skills: C++ Programming

See more: how to write a good written assignment for standard level english a, academic standard assignment, assignment matrix addition, java file input output assignment, assignment standard costing excel, assignment university standard, standard browser keys, printing perl output columns xls, wellsite information transfer standard update, standard shortcut keys web apps, standard report output excel oracle 11i, standard website printing company, comsol output matlab transfer, printing prepress standard operating procedure manual, perl printing script output file

About the Employer:
( 1 review ) Blacksburg, United States

Project ID: #13133371

Awarded to:


Hello. How are you. I have read and understood the project. I'm an Expert in Data Structures and Algorithms. And I know well ; Java ,C/C++, Python ,PHP. I'm interested this project. So, firstly I want to discu More

$90 USD in 2 days
(78 Reviews)

6 freelancers are bidding on average $161 for this job


Dear client, how are you? I am a C/C++ programmer and mathematician. Please check my "Profile & Work List" and contact with me if my skill is in your concern. Looking forward to your response. Thanks.

$300 USD in 3 days
(61 Reviews)

Hi,dear. Thank you for your interest. I have just checked your project report,I am able to perform this task with my developer team.I look forward to your proposal...

$155 USD in 1 day
(14 Reviews)

I, Jignesh Lakhani have completed [url removed, login to view] from IIT Roorkee. I am having very good knowledge of C, C++, Java and data structure. hope we will discuss more on it. thanks, Jignesh

$111 USD in 2 days
(5 Reviews)

Dear Sir, SCOPE : C++ Programming Well understood , I can do it , let us discuss more. Technologies we work @vrickson : (a )Websites / Web Portals / Software ( PHP/WP/Pearl/ASP.Net/C/C++/C# / GoAlan More

$277 USD in 3 days
(0 Reviews)

Dear client i can provide complete solution on your project as i have executed it before. My commitment lies in honesty, integrity, ethical code of conduct, efficiency and speedy respond, i love to work hard to meet More

$30 USD in 1 day
(0 Reviews)