/**
 * BugDemoApp.java
 *
 *
 * Created: Sat Jan 11, 2003
 *
 * @author <a href="mailto:shapiro@cse.buffalo.edu">Stuart C. Shapiro</a>
 * 
 * Demonstrates the usefulness of Java assertions and exceptions.
 */

public class BugDemoApp {

    /**
     * Prints <code>n</code>, formatted as a 10-digit phone number,
     * with the comment that it is a possible phone number.
     * <p>
     * <b>pre:</b> <code>n</code>.length == 10.
     * <p>
     * <b>post:</b> <code>n</code> is printed as a 10-digit phone number,
     * formatted as a phone number,
     * with the comment that it is a possible phone number.
     *
     * @param n a 10-digit <code>String</code>.
     */
    public static void CheckPhoneNumber (String n) {
	System.out.println(n.substring(0,3) + "-" + n.substring(3,6)
			   + "-" + n.substring(6)
			   + " is a possible phone number.");
    }

    /**
     * Driver for BugDemoApp,
     * demonstrating a bug due to a failed precondition.
     *
     */
    public static void main (String[] args) {
	CheckPhoneNumber("7165551234");
	CheckPhoneNumber("201467");
    } // end of main ()
    
    
}// BugDemoApp
