Name: __________________
Objective: while loops and the strtok method
Instructions
-
Create a new project called Translation
-
Import the files from Lab 10 Translation
-
Your program will continuously read in a sentence of text from the user, until the user indicates that he or she is finished. You will have to decide how the user indicates they’re done. (Be sure to say so in your prompt.)
- For each string you read in, use the StringTokenizer class to take the sentence apart and reassemble it, replacing the word “Thomas” with “Kretsch”, and vice-versa. Print the new sentence.
-
Translate possessives. In other words, Kretsch’s should be translated to Thomas’s and vice versa.
-
At the end of the program, print the total number of changes you made
Wrap-up
-
Print a copy of your source code.
-
Hand in the code with the print-out of the PDF version of these instructions
Grading
|
|
Points
|
Correct
|
Incorrect
|
None |
|
String input
|
5
|
|
|
|
|
String translation
|
7
|
|
|
|
|
Word count
|
3
|
|
|
|
|
Total
|
15
|
|
|
|
Notes
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
Comments (0)
You don't have permission to comment on this page.