View
 

Lab 10: Translation

Page history last edited by Mr. Kretsch 6 months ago

Name: __________________

Objective: while loops and the strtok method

Instructions

  1. Create a new project called Translation

  2. Import the files from Lab 10 Translation

  3. 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.)

  4. 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.
  5. Translate possessives. In other words, Kretsch’s should be translated to Thomas’s and vice versa.

  6. At the end of the program, print the total number of changes you made 

Wrap-up

  1. Print a copy of your source code.

  2. 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.