Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a method called pigLatin that accepts as a parameter a Scanner representing an input file. Your method should, preserving line breaks, print out the

image text in transcribed

Write a method called pigLatin that accepts as a parameter a Scanner representing an input file. Your method should, preserving line breaks, print out the input file's text in a simplified version of Pig Latin, a silly English variant where the first letter of each word is moved to the end. Our rules for translating a word to Pig Latin are as follows: . If the word starts with a vowel (a, e, i, o, or u), append "yay". For example, "elephant" becomes "elephantyay". If the word starts with a consonant, move the consonant to the end, and append "ay". For example, "welcome" becomes "elcomeway". You should also convert every word to lowercase. For example, if the input file contains the following text: Shall I compare thee to a summer's day Thou art more lovely and more temperate For the preceding input, your method should produce the following console output: hallsay iyayomparecay heetay otay ayay ummer'ssay ayday houtay artyay oremay ovelylay andyay oremay emperatetay

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

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

LO1 Discuss four different views of motivation at work.

Answered: 1 week ago

Question

LO6 Summarize various ways to manage retention.

Answered: 1 week ago