Question: Language in C++ Objective : Design a program that uses abstract classes. To be completed by a group of 3 people. Assignment : In cryptography,

Language in C++

Objective:

Design a program that uses abstract classes. To be completed by a group of 3 people.

Assignment:

In cryptography, encryption is the process of encoding a message or information in such a way that only authorized parties can access it. In this lab you will write a program to decode a message that has been encrypted.

Detailed specifications:

Define three classes. Each one should be in a separate file. You can choose to define the class and its functions inline, all in a header file, or have a .h and .cpp file for each class.

  • Abstract base class with the following:
    • A variable to hold an encrypted message. This variable should be a string which is initialized in the constructor.
    • A status variable that will tell whether the message was loaded successfully.
    • A constructor that receives one parameter: a string variable with a file name and uploads its content to the string variable that is supposed to store it.
    • A pure virtual function called decode. This function will be defined in derived classes.
    • A function that prints the message on the screen
  • A derived class that implements a version of decode according to the following algorithm:
    • input character: abcdefghijklmnopqrstuvwxyz
    • decoded character: iztohndbeqrkglmacsvwfuypjx
    • That means each 'a' in the input text should be replaced with an 'i', each 'b' with a 'z' and so forth.
  • A second derived class that implements a version of decode according

    algorithm known as "rotational cypher". In this encryption method, a key is added to each letter of the original text. For example:

    Cleartext: A P P L E Key: 4 4 4 4 4 Ciphertext: E T T P I

    In order to decode, you need to subtract 4.

Turn in:

Encrypted.h, CypherA.h and CypherB.h (corresponding .cpp files optional).

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!