CH5PP1.java - Pig Latin [email protected] [email protected] import java.util.Scanner public class CH5PP1 public static void main(String args Scanner

CH5PP1.java - Pig Latin [email protected] [email protected]

This preview shows page 1 out of 1 page.

/** * Pig Latin translator * * @Zac Register * @Halloweenie */ import java.util.Scanner; public class CH5PP1 { public static void main(String[] args) { Scanner something = new Scanner(System.in); System.out.print("Are you trying to translate an entire sentence (type 'yes' or 'no')"); String test = something.next(); while (test.equals("yes")){ Scanner piggy = new Scanner(System.in); String word; String translation = ""; char first; boolean cap = false; String line; System.out.print("enter a line you want to translate: "); line = piggy.nextLine(); piggy = new Scanner(line); while (piggy.hasNext()) { word = piggy.next(); first = word.charAt(0);
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Winter '16
  • Fontaine, M
  • Science, Metaphrase, literal translation, public class CH5PP1

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture