Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help in C++ Fast, Thank you PROJECT COMPONENTS: A Caesar Cipher is a code where each letter of a message is exchanged with the

Need help in C++ Fast, Thank you

image text in transcribedimage text in transcribed

PROJECT COMPONENTS: A Caesar Cipher is a code where each letter of a message is exchanged with the letter that is n (called the shift value) letters down from it in the standard alphabet. So, for instance, a Caesar Cipher with the shift value of 5 will look like this: Standard Alphabet: abcdefghijklmnopqrstuvwxyz Cipher Alphabet: fghijklmnopqrstuvwxy zabcde So, the message "cakeinthebreakroom (assume spaces are omitted, use only lower-case letters) becomes: hfpjnsymjgwjfpwttr. For this assignment I have provided a class called caesarCipher (caesarCipher.h) that has as its only private attribute an integer that stores the shift value. The class has a parameterless constructor that sets the shift value to 1 and an overloaded constructor that accepts a single integer parameter and sets the shift value to the value of the parameter. The caesarCipher class has a member method called encrypt that accepts a string representing the original message and returns a string representing the encrypted message. The class also has a method called decrypt which reverses this process. Finally, there is a print method that prints out the shift value. Consider writing a simple main function to test this class. === For this assignment you are to create a new class called advancedCaesar which inherits from caesarCipher. In addition to the inherited attributes, the new class should have a single private attribute which is an array of characters for storing the cipher alphabet (the 26 character alphabet stored in order AFTER it has been shifted the shift value amount). It should have a parameterless constructor and a constructor that accepts a single integer. Each constructor is responsible for setting the values of the character array to the 26 letters of the alphabet in the order dictated by the shift value and also make use of the inherited constructors. The new class should also have a print function that now prints out not only the value of the shift value, but also the cipher alphabet. Finally, write a main function that creates an instance of advancedCaesar and tests all of its methods: including it's constructors, it's print method, and encrypt and decrypt (use cout statements to print the result of encrypt and decrypt). (Note: DO NOT write a new version of encrypt and decrypt methods; instead use the inherited versions). Submit AT MINIMUM the following files in a single compressed folder to Canvas before the due date: main.cpp caesarCipher.h advancedCaesarh . #include using namespace std; class caesarCipher { private: int shiftValue; public: caesarCipher() { shiftValue = 1; } caesarCipher (int sv) { shiftValue = sv; } string encrypt (strings) { for(int i=0; i= 97 66 3[i] 122) { 3[i]=122-(3[1]97); } else { 3 [i]+=shiftValue; } } } return 3; } string decrypt (string 3) { for(int i=0;i= 97 && s[i]

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_2

Step: 3

blur-text-image_3

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions