Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 59 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. import java.util.Scanner;
  2. public class PigLatin
  3. {
  4.    //-----------------------------------------------------------------
  5.    //  Reads sentences and translates them into Pig Latin.
  6.    //-----------------------------------------------------------------
  7.    public static void main (String[] args)
  8.    {
  9.       String sentence, result, another = "y";
  10.       Scanner scan = new Scanner (System.in);
  11.       PigLatinTranslator.translate(sentence);
  12.       while (another.equalsIgnoreCase("y"))
  13.       {
  14.          System.out.println ();
  15.          System.out.println ("Enter a sentence (no punctuation):");
  16.          sentence = scan.nextLine();
  17.          System.out.println ();
  18.          result = PigLatinTranslator.translate (sentence);
  19.          System.out.println ("That sentence in Pig Latin is:");
  20.          System.out.println (result);
  21.          System.out.println ();
  22.          System.out.print ("Translate another sentence (y/n)? ");
  23.          another = scan.nextLine();
  24.       }
  25.    }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top