THE REAL PHRASE: hello there
AS A CRYPTOGRAM: acbbo facrc
[a = h, b = l, c = e, d = o, e = r, f = t]
Lab Setup
Put this program in your labs folder in a subfolder called 3.
Create a new project called "Cryptogram". Name your application program "CryptoApp"
Feel free to create helper classes - or simply use helper static methods in the application program.
If you work efficiently, you should be able to complete this lab in eighty minutes.
The hardest part should be creating the algorithm that randomly will assign different letters to correspond to other letters.
Any design concern not explicitly explained allows you the freedom to program it however you choose.
Instructions
You are to design a program that asks the user for a sentence.
Then, using an algorithm of your choice:
- Create a new string that replaces each letter with its corresponding code letter.
- Output the new string.
Loop until the cryptogram has been solved:
- Have the user type the letter they would like to decipher (ie. guess what it really should be)
- Have the user enter the letter they believe it should be (above, an "a" should be an "h")
When the game is over, ask if the user would like to start over (enter a new sentence that will be "cryptogrammed")