Pig Latin is a language game made by modifying English words:
If the letter in a word starts with a consonant:
Step 1: Remove the first letter of the word.
Step 2: Add a “-” to the end of the word.
Step 3: Add the removed letter.
Step 4: Add ”ay”.
If the letter starts with a vowel just add “-yay“ to the end of the word.
Task:
Write a program that will translate a sentence into Pig Latin.
Constraints:
[Note: Your code does not need to check constraints - they are provided so you know the range of test data values your program will need to handle.]
- The provided input will only consist of uppercase and lowercase letters, and spaces between words.
Input format:
- An English sentence or group of words.
Output format:
- A string consisting of the translated input.
Example:
Input:
Hello internet
Output:
ello-Hay internet-yay
[Notes: Do not include text prompts for any inputs. For languages such as Java/C# which require a class definition, the main class should be called: Solution.]