Understanding the problem: For this project each of you will create a Mealy machine (a finite state
Question:
Understanding the problem:
For this project each of you will create a Mealy machine (a finite state machine with output) to create the “crypto-quotes” found in the local newspaper. You can find a commercial example at the Arkansas Democrat Gazette, online (Links to an external site.). Here is an example generated by this program:
The cryptoquote text: ABA CU Q YQVCGWNBTS AMJ Q YQVCGWNBTS CU GBJ ABA.
Comes from the quotation: Bob is a palindrome but a palindrome is not Bob.
With the key value:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Q A Z W S X E D C R F V T G B Y H N U J M I K O L P
The program you create shall take the following as input:
- A sequence of 26 non-repeating alphabetic characters, representing the mapping to be used for substitution cypher
- A string containing the quote to be encrypted.
Note: Your program should leave non-alphabetic characters unchanged (space=space, ‘,’=’,’, etc.) and convert all alphabetic characters to uppercase.
Output shall be the crypto quote, ready to be solved.
Derive and implement a way to use your program to check a solved crypto-quote (your program does NOT have to solve crypto quotes). Modify your program to allow a user to perform either a crypto-quote check or a crypto-quote create using the same input sequence of 26 non-repeating characters.
NOTE: While the sample program accepts strings until a mapping for all 26 uppercase letters is provided, your program may require a unique permutation of the 26 letters to create a key. Just be sure you don't have any repeated letters in the key you create.
Hint: for mine I use two arrays, one is indexed by the original alphabet A, B, ...., Z, and stores the key (i.e., A->P) and the other is indexed by the key letters, A, B, ... , Z, and stores the original letter (i.e., if A->P in the first array, P-> A in the second). I then use one array to create cryptoquotes and the other to decode cryptoquotes using the same function.
C++