URL (small or very large…). The API should uphold the principles of loose-coupling and high
cohesion throughout its design by correctly applying abstraction, encapsulation, composition,
inheritance and polymorphism. The output of the programme should be a text file containing
each of the words encoded as a unique five-digit number, displayed ten codes per line like the
original Zimmerman telegram.
As illustrated in Fig. 1, the API should:
• Build an encoding and a decoding lookup table for a set of commonly used English
words. Use instances of the Map interface to relate words to numbers and numbers to
words. A text file containing 900 commonly used English words, ranked in
descending order by usage frequency, is available on Moodle1
• The application should generate a total of 75,000 random unique integers to associate
with the 900 words, enabling multiple numbers to be assigned to each word. Wordswith a higher usage frequency should be given more numbers than those that are used
rarely. You should try to avoid using the same number twice in a message (this will
not be possible for a large text file) as repetition is the mortal enemy of a
• The application should parse a given input file or URL line-by-line, extract each word
in the line of text, encode it as an integer and append it to an output file.
Please note the following additional requirements:
• You must comment each method in your application stating its running time (in Big-
O notation) and your rationale for its estimation.
• Document your code using the JavaDoc standard. JavaDocs are an industry standard
for inline documentation of Java classes. A quick JavaDoc tutorial, from the
University of Birmingham, is available on Moodle. Eclipse provides full support for
the JavaDoc standard, including intelli-sense drop down suggestions.
• Provide a UML diagram of your design (a photograph of a neatly-drawn sketch will
suffice). Please pay particular attention to how your application must be packaged