subject

BJP5 Exercise 6.20: pigLatin Language/Type: Java file processing Scanner
Author:Marty Stepp (on 2019/09/19)

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 iyay omparecay heetay otay
ayay ummer'ssay ayday houtay artyay oremay
ovelylay andyay oremay emperatetay

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 1
question
Computers and Technology, 23.06.2019 04:20
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
You know the right answer?
BJP5 Exercise 6.20: pigLatin Language/Type: Java file processing Scanner
Author:Marty Stepp (...
Questions
question
English, 08.12.2020 02:40
question
History, 08.12.2020 02:40
question
Mathematics, 08.12.2020 02:40
Questions on the website: 13722360