Project 2: Talk Like A Pirate

(modified from an assignment by Dave Reed)

Due: Friday, March 7 at 11:59 pm.


In 1995, John Baur and Mark Summers invented a new holiday, International Talk Like a Pirate Day. As they proposed it, on every September 19th, people around the world would be encouraged to talk like a pirate (with lots of "Arrrrs" and "Ahoys" and the like). At the official Talk Like a Pirate Day Web site, http://www.talklikeapirate.com/, you can read about the history of the holiday, order official merchandise, and even experiment with a simple Web page that translates simple English phrases into pirate talk.

Your assignment is to create a program that takes an English text string and translates it into Pirate talk.

D-level functionality (correctness)

Design and implement the basic program without the translation.  So it should prompt the user for a string and respond with the same string.  Use the TechSupport system design from chapter 5, but replace the Responder with a Translator.  All manipulation of the input string should take place within the Translator class and your equivalent to the SupportSystem class should be called CommunicationSystem.  It should function basically the same as the SupportSystem class with the following exceptions:

C-level functionality (correctness)

D-level with the following modifications:

Your CommunicationSystem should prompt the user for an English text string and output a translation where the following words/phrases are replaced with their pirate translations:

English

Pirate

hello

ahoy

hi

yo-ho-ho

my

me

friend

bucko

sir

matey

madam

proud beauty

stranger

scurvy dog

where

whar

is

be

the

th'

you

ye

tell

be tellin'

know

be knowin'

old

barnacle-covered

nearby

broadside

restaurant

galley

You should not need to modify the CommunicationSystem class from D-level functionality.  Instead, the method in the Translator class which provided the echo of the input string should now produce a translated string.  Use a HashMap within the Translator class to store the phrases and their translations so that more phrases can be added later.  You can assume that there is no punctuation in the input string. 

B-level functionality (correctness)

C-level plus the following:

A-level functionality

To the B-level functionality, add at least one additional feature.  The feature should be non-trivial and should indicate some effort. If you have an idea and are not sure, clear it with me first.  Ideas include:

pardon me

avast

excuse me

arrr

how far

how many leagues

Notes on Style

See the style guide posted on our web site. Approximately 30 percent of your project grade will be based on coding style, including documentation. Generally I will divide this into an assessment of

Deliverables -- what should you hand in?

The handin name for this project is project2. It will be due at 23:59 Friday, March 7. When you hand it in, please handin the entire directory for project2. Copy the files to a directory called project2 on cerebro and then, from the directory above project2, type:

 
handin 180 project2 project2/*

Check the syllabus for a discussion of academic honesty. This project must be your own work.