C++

Aisha A.

asked • 07/13/20

c++ program data structure

There is a simple encryption scheme that is called “Caesar Cipher”. In a “Caesar Cipher”, the

letters in a message are replaced by the letters of a “shifted” alphabet. A “Caesar Cipher”

encodes a message by shifting each letter in a message by a constant amount of k. If k is 5, A

becomes F, B becomes G, C becomes H and so on.

Let's use Queue to encode and decode the encrypt message. Set k as -5 and decipher the

following codes by using Linear Queue.

Encrypt message: H T S L W F Y Z Q F Y N T S X

NOTE: Assume the following functions have been implemented in the Queue class. You

may USE or CALL any of these functions.

 void Enqueue(char kod);

 void Dequeue();

 char QueueFront();

 char QueueRear();

 bool Empty();

 bool Full();

a. Write the code snippet for main() function to decode the encrypt message. Then, insert

the decoded message into the Queue and display the message from the Queue.

The encrypt message is stored as the following:-

char code[16] = "HTSLWFYZQFYNTSX";


b. State the result of your output.

1 Expert Answer

By:

Patrick B. answered • 07/13/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.