// SkeletonTwo.java // for Java 1.5 (uses Scanner) // a starting point for programs // N V Fitton fall 2005 // vfitton@nvcc.edu import java.util.Scanner; public class SkeletonTwo { public static void main(String args[]) // "throw" is necessary to use System.in.read() // at end throws java.io.IOException { // set up input object Scanner keyboard = new Scanner(System.in); // string object to control loop String keysIn; // replace with your introduction System.out.println("\n\t Program introduction..."); do { // --- snip --------------------------------- // --- replace with your programming exercise System.out.println("\n\t Program body...\n"); // --- snip --------------------------------- System.out.print("\n\t Do it again [y/n]? "); keysIn = keyboard.next(); } while (keysIn.startsWith("y") || keysIn.startsWith("Y")); System.out.println( "\n\t Program ending." + " Please press the Enter key..."); // wait for input, do nothing with it int c; while ((c = System.in.read()) != '\n') ; } }