A cryptoquote is an encoded quotation obtained by substituting one letter for another. For example, the phrase “To be or not to be” could be encoded as “AB CD BE FBA AB CD,” by making the following...


A cryptoquote is an encoded quotation obtained by substituting one letter for another. For example, the phrase “To be or not to be” could be encoded as “AB CD BE FBA AB CD,” by making the following substitutions: A for t, B for o, C for b, D for e, E for r, and F for n. Note that letters need not be substituted in alphabetical order, as we have done here.


Write a program that presents a cryptoquote and enables the user to replace letters to solve the puzzle. Along with the cryptoquote, the program should indicate the frequency with which each letter occurs in the cryptoquote.


For example, using the previous cryptoquote, the program’s output might begin as follows:


AB CD BE FBA AB CD


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


3 4 2 2 1 1


Solve the puzzle!


Replace: C b


AB bD BE FBA AB bD


Replace: A n


nB bD BE FBn nB bD


Replace: n t


tB bD BE FBt tB bD


Use an array of characters instead of a string to represent the cryptoquote. Notice that the user can change a replacement, as shown with n in the last two lines of the example.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here