Answer:
class PigLatin:
# The user is prompted for input
# the input is stored in userInput
userInput = str(input("Enter your word: "))
# The pigLatinWord is created by concatenation
# using python slicing feature
# userInput[1:] mean the userInput from index 1 to the end
# userInput[0] refer to the first letter of userInput
pigLatinWord = userInput[1:] + userInput[0] + "ay"
# piglatinword is displayed.
print(pigLatinWord)
Explanation:
The code is written in Python and well commented. A class pigLatin is created. The user is prompted for input which is converted to String and assigned to userInput. Then python slicing is use to create the pigLatinWord. The first slice userInput[1:] return the letters after the first index till the end. userInput[0] return the first letter. We then add "ay" at the end to complete the pigLatinWord.
Finally, the pigLatinWord is displayed.