A+ Work





CIT staff have requested that an application be developed that would enable them to translate some of the correspondence that they receive. The reason for this is that, nowadays, a lot of correspondence contains various acronyms, e.g. lol, omg, etc., that those of a certain generation are unfamiliar with.

You have been asked to create a Java application as a prototype of the type of system that could be developed. The program will maintain a text file which will act as a dictionary of acronyms, their translations and how frequently each acronym has been used since it was added to the dictionary. For the prototype, it is sufficient to assume that the dictionary can contain a maximum of 100 acronyms.



The following is a sample layout for the dictionary text file:

--------------------

lol

laugh out loud

32



cu 

see you 





xxx 

kisses 





121 

one to one 



....

----------------------

You have been told that there will essentially be two types of users of the application, i.e.: 



*A General User



This type of user will have the following functionality available to them:

Keyboard Input– the user will be able to enter a line of text via the keyboard which they would like translated. The program translates the entered line of text, displaying the translated text to the screen and informing the user how many replacements were made to the text entered. The usage statistics for any acronyms used should be updated appropriately.



File Input – the user will be able to provide the name of a text file that contains text that they want translated. The program translates the text in the file, displaying the translated text to the screen and informing the user how many replacements were made to the text in the file. The usage statistics for any acronyms used should be updated appropriately.



Statistics – the user can view:



The usage statistics for a specific acronym the program has in its dictionary

*The usage statistics for all acronyms the program has in its dictionary. 

*The most frequently used acronym.

*The least frequently used acronym. 



-An Administrator 

This type of user will have the following functionality available to them:



View all Acronyms – the user will be able to view a complete listing of all the acronyms currently available in the dictionary along with their translations.



Add an Acronym - the user will be asked for the acronym to be added, provided the acronym entered isn’t already in the dictionary, the user will be asked for the translation of the acronym and it will be added to the dictionary with a usage statistic of 0.



Edit an Acronym - the user will be asked for the acronym to be edited, provided the acronym entered is already in the dictionary, the user will be asked for the new translation of the acronym and the dictionary will be updated to reflect the change.



Delete an Acronym - the user will be asked for the acronym to be deleted, provided the acronym entered is already in the dictionary the specified acronym will be removed from the dictionary.



Statistics – the admin can view (same as user):



*The usage statistics for a specific acronym the program has in its dictionary 

*The usage statistics for all acronyms the program has in its dictionary. 

*The most frequently used acronym. 

*The least frequently used acronym. 



Sample Translation Run



Sample file contents before translation service being ran

-----------------

lol 

laugh out loud 

32



cu 

see you 

7



xxx 

kisses 

6

-----------

Please enter your text for translation: 



omg I totz luv java. lol i can c u getting all the xxx as a java programmer. 



Translation Results: oh my god I totally love java. Laugh out loud i can see you getting all the kisses as a java programmer.

Sample file contents before translation service being ran.

------------

lol

laugh out loud 

33 



cu 

see you 

8



xxx 

kisses 

7

--------------

The above assumes that omg, totz, luv have each been added to the above abbreviation file by the administrator and would have their usage count updated accordingly. Note in the above example, see how the abbreviations quoted in the sample file contents have each been incremented by one.



Marking Scheme



Documentation (DataDictionary 10%, Functional Test Scripts 15%) 25%

User Functions (Keyboard Input 10%, File Input 10%, Stats 15%) 35%

Administrator Functions (View 5%, Add 15%, Edit 10%, Delete 10%, Stats 0%) 40%



NB You only use concepts that have been covered within the module, 

e.g. you do NOT use ArrayLists.