Problem

Cryptography. The science of developing secret codes has interested many people for centur...

Cryptography. The science of developing secret codes has interested many people for centuries. Some of the simplest codes involve replacing a character, or a group of characters, with another character, or group of characters. To easily decode these messages, the decoder needs the “key” that shows the replacement characters. In recent times, computers have been used very successfully to decode many codes that initially were assumed to be unbreakable. The next set of problems considers simple codes and schemes for decoding them. Generate files to test the programs.

Write a program that encodes the text in a data file using an integer array named key that contains 26 characters. This key is read from the keyboard; the first letter contains the character that is to replace the letter a in the data file, the second letter contains the letter that is to replace the letter b in the data file, and so on. Assume that all punctuation is to be replaced by spaces. Check to be sure that the key does not map two different characters to the same one during the encoding.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search