Question
(this assignment is using Eclipse.)(prog Java) Create a program that will take in an English sentence and translate it into Pig Latin . Read the
(this assignment is using Eclipse.)(prog Java) Create a program that will take in an English sentence and translate it into Pig Latin . Read the explanation in Wikipedia of how to translate English words to Pig Latin. If the word starts with a consonant: the first letter is moved to the end of the word then ay is added to the end. If the word starts with sh, ch, or th; move those 2 letters to the end of the word, then add ay to the end. If the word starts with a vowel: just add way to the end of the word. The translation must be done in a function. The original word will be passed to this function and return the translated word back to the function call. Also add a choice for the user to decide if they want to translate another phrase after the current phrase has been completed and displayed to the user. To easily know when you have the last word, instruct the user to add punctuation at the end of the sentence (period, exclamation points, or question mark). Therefore, you can check the last character of the word to see if it is a . or ! or ? and know if it is the last word of the sentence. Note: if you are going to put that last character in a variable, it will be a char type since it is one character. Remove the punctuation from the last word before converting it to pig latin.
Notes: Be sure to have try-catches in your code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started