MR. MERLIS’ COMPENDIUM OF LAB FUN
The Cryptogram Lab
hello there --> acbbo facrc
[a = h, b = l,
c = e, d = o, e = r, f = t]
Description
You are to design a
program that asks a 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
-
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”)
Lab
Details
Put this program in
your labs folder in 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.