SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 305 Weeks Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 04 Jan 2018 My Price 7.00

class reads in multiple lines of text, ending finally

Pig latin works this way: if a word begins with a vowel (a-e-i-o-u), then "ay" is added to the end of the word (so "idle" -> "idleay", and "often" -> "oftenay"); on the other hand, if a word begins with a consonant, then the first letter is removed, and is placed at the end of the word, followed by "ay" (so "month" -> "onthmay", and "castle" -> "astlecay").

 

The

PigDriver

class reads in multiple lines of text, ending finally with two carriage returns. At each line entered, the

pigConvert

method in your

PigLatin

class is called to convert that string to pig latin form. After the reading segment ends, your

PigLatin

class should then print the pig latin translation of the input text- the

pigReport

method. As a simplification, report the translation with no punctuation, and in all lower case.

 

Below we give you the driver (the PigDriver class). Your job is to write the Piglatin class so that PigDriver works appropriately.

import java.util.*;
public class PigDriver{
  public static void main(String[] args){
   Scanner scan = new Scanner(System.in);
   String t = " ";
   Piglatin p = new Piglatin();
   while(t.length() > 0){
     t = scan.nextLine();
     t = t.toLowerCase();
     p.pigConvert(t);
   }
   p.pigReport();
  }
} 

 

On this input:

Now is the time,
for all good, and I mean very good men and women,
to visit their grandmothers!

 

The following output was produced:

ownay isay hetay imetay 
orfay allay oodgay anday iay eanmay eryvay oodgay enmay anday omenway 
otay isitvay heirtay randmothersgay 
Requirements:
  1. YourPiglatinclass must define and implement thepigConvertmethod, which takes a line of text as a parameter and does not return a value. It does the conversion to pig latin and stores the result.
  2. YourPiglatinclass must define and implement thepigReportmethod, which takes no parameters and prints a report (as specified above) to the console.
  3. You must use theStringmethodsplitwith this parameter:"[ ,.!?;:]"AND NO OTHER in yourPiglatinclass.
  4. You may not use theArrayListclass for this project.

Answers

(5)
Status NEW Posted 04 Jan 2018 01:01 PM My Price 7.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)