This lab uses the subroutine you've written in your prelab to convert entire sentences to PigLatin. Your code will perform the conversion to Pig Latin using the ConvertToPigLatin subroutine.
You will edit the code in PigLatin.java
Problem: Create an applet that takes in an input sentence from
the user and converts the sentence to Pig Latin.
The basic algorithm
Just to get you started, you know you can convert a single word to
Pig Latin. How would you convert a chain of words (aka a sentence) to Pig
Latin?
What to do:
The subroutine from your prelab to
convert 1 word to Pig Latin (ConvertToPigLatin())
has been filled in for you. You will have to call on it to perform the
rest of the algorithm.
The loop to covert a sentence to Pig Latin has been started
for you. What does the condition in the while statement
do?? Fill in the rest of the loop to finish your algorithm.
Don't forget the note below the loop!
How to Compile and Run your code.
Add your name, section number, and date to both the
.java file and the .html file.
Test your code!!! Your entire input sentence should
correctly translate to an output sentence in Pig Latin. Come up
with some test sentences, and be sure to test all cases. Here
is an example sentence that tests all three cases:
You will be submitting your PigLatin.java file.
Requirements
Remember to ...
My dog has fleas again
You should come up with some more sentences on your own.
Submitting
Jeff Forbes
<forbes@cs.duke.edu>