Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * You work for a spy agency, and have been tasked with writing a program that can decipher encoded words.
- *
- * Words are encoded using a 1:1 character mapping.
- * For example, if the character mapping being used is a->3, b->Z, c->#, d->7,
- * Then the word 'dad' would be represented as '737'
- *
- * Your DecipherApp does not know what the character mapping is.
- * Instead, it just has a fixed list of all of the possible decoded words.
- * e.g. KnownWords = {"book", "took", "tar", "dad", "bib", "deed", "peep"}
- *
- * DecipherApp is a command line program.
- * It continues to ask the user to enter an encoded word to decipher, until the user enters "quit".
- * Given an encoded word, the program will output all possible decoded words, based on the character pattern.
- * For example, if "7##7" is the input, then "deed" and "peep" would be the output.
- * Please enter a word to decode
- * 7##7
- * Possible words are:
- * deed
- * peep
- *
- * Please enter a word to decode
- * xyz
- * Possible words are:
- * tar
- *
- * Please enter a word to decode
- * 888
- * Unable to find any words that match this pattern.
- *
- * Please enter a word to decode
- * quit
- * Goodbye.
- */
- public class DecipherApp {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement