ICS3U Introductory String Operations

The purpose of this investigation is to gain familiarity with some of the more common methods of the String class. These exercises assume you have a basic familiarity with the if statement.

Task.

  1. Create a project called StringOps and add statements in the main method that will read a user's first name in from the console window. In each of the tasks, the original name is not to be modified.
  2. Echo a greeting to the console window, welcoming the user, by name, in all caps.
  3. Tell the user how many letters he has in his name.
  4. Display a modification of the user's name with his first and last letter reversed.
  5. Inform the user if he has the most common letter, 'e', in his name.
  6. Display the location within the user's name of the last 'a'. If the name does not contain an 'a', say so.
  7. Display the location within the user's name of the last vowel.
  8. Convert the user's name to Pig Latin. One dialect of Pig Latin removes the initial string of consonants, appends it to the end of the name and adds the suffix 'ay'. Hence, Ryan becomes yanRay, Chris becomes isChray, Patrick becomes atrickPay, Sam becomes amSay, Connor becomes onnorCay, Wes becomes esWay, and Zach becomes achZay.