PigLatin2 - do { System.out.println (); System.out.println...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // PigLatin2.java Author: Lewis and Loftus // // Solution to Programming Project 5.1 //******************************************************************** import java.util.Scanner; i public class PigLatin2 { //----------------------------------------------------------------- // Reads sentences and translates them into Pig Latin. //----------------------------------------------------------------- public static void main (String[] args) { String sentence, result, another;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: do { System.out.println (); System.out.println ("Enter a sentence (no punctuation):"); Scanner sc = new Scanner(System.in); sentence = sc.nextLine(); System.out.println (); result = PigLatinTranslator2.translate (sentence); System.out.println ("That sentence in Pig Latin is:"); System.out.println (result); System.out.println (); System.out.print ("Translate another sentence (y/n)? "); another = sc.nextLine(); } while (another.equalsIgnoreCase("y")); } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online