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 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
Terri needs to insert a cover page into her document. where should she go to access the commands to do so? o insert tab, objects group o insert tab, illustrations group o insert tab, pages group o insert tab, media group submit
Answers: 1
question
Computers and Technology, 22.06.2019 22:50
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 23.06.2019 00:20
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
You know the right answer?
BJP5 Exercise 6.20: pigLatin Language/Type: Java file processing Scanner
Author:Marty Stepp (...
Questions
question
Mathematics, 02.06.2021 16:20
question
Mathematics, 02.06.2021 16:20
question
Mathematics, 02.06.2021 16:20
question
English, 02.06.2021 16:20
question
Mathematics, 02.06.2021 16:20
question
Computers and Technology, 02.06.2021 16:20
Questions on the website: 13722361