Question: Write a program that reads lines of input from the user and converts each line into Pig Latin. Pig Latin is English with the initial

 Write a program that reads lines of input from the user

Write a program that reads lines of input from the user and converts each line into "Pig Latin." Pig Latin is English with the initial consonant sound moved to the end of each word, followed by "ay". Words that begin with vowels simply have an "ay" appended. Your program should continuously prompt the user for sentences until they enter a blank line, at which point the program should terminate. SAMPLE RUN #1: java PigLatin Interactive Session Hide Invisibles Highlight: None Show Highlighted Only O Enter a sentence to translate:It was a bright cold day-in-April.and.the.clocks were striking.thirteend It-ay.as-way.a-ay.ight-bray.old-cay-ay-day.in-ay. April-ay-and-ay.e-thay.ocks-clay ere-way.riking-stay.irteen-thay. Enter.a. sentence.to-translate:It was the best of times.it was the worst of times It-ay.as-way.e-thay.est-bay.of-ay.imes-tay.it-ay.as-way.e-thay.orst-way.of-ay.imes-tay.. Enter a sentence to translate:If you really want to hear about it the first thing you'll want to know.is.where. I was bornd If-ay-ou-yay.eally-ray.ant-way.o-tay.ear-hay-about-ay.it-ay.e-thay-irst-fay.ing-thay.ou'll-yay.ant-way.o-tay-ow-knay-is-ay.ere-whay. I-ay-as-way.orn-bay.d Enter a sentence to translate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!