Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write your code in the file PigLatin.java. Your code should go into a method with the following signature. You may write your own main method

Write your code in the file PigLatin.java. Your code should go into a method with the following signature. You may write your own main method to test your code. The graders will ignore your main method: public static String translate (String original){}

"Pig Latin" is a fake language used as a children's game. A word in English is "translated" into Pig Latin using the following rules:

If the English word begins with a consonant, move the consonant to the end of the word and add "ai". The letter Y should be considered a consonant.

If the English word begins with a vowel (A, E, I, O, or U), simply add "vai" to the end of the word.

(This is a simplified dialect of Pig Latin, of course.)

Write your method so that it returns the pig latin translated original string. You may assume that the input does not contain digits, punctuation, or spaces. The input may be in any combination of uppercase or lowercase. The case of your output does not matter.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

=+ identify the main symptoms of failure

Answered: 1 week ago

Question

1. Explain how technology has changed the learning environment.

Answered: 1 week ago