/** This is a driver class PostalFees which sort the two types of postal materials * A pdf i used to locate information * http://pe.usps.com/cpim/ftp/manuals/dmm300/Notice123.pdf * * @author Freeman Lo * @version 0.0.1 Build 1 Jan 28, 2014. * Limitations - Letters must be less than or equal to 3.5 ounze * Limitations - Envelopes must be less than or equal to 13 ounze * */ import java.io.*; import java.util.*; import java.lang.*; public class PostalFees { public static void main(String[] args) throws IOException { String mess; Scanner scan = null; scan = new Scanner(System.in); System.out.print("Please enter the type of postal item <(L)etter/(E)nvelope> ? "); mess = scan.nextLine(); mess = mess.trim(); if ( mess.equalsIgnoreCase("letter") == true || mess.equalsIgnoreCase("l") == true ) { Letter let = new Letter(); // Creating an letter instance let.askWeight(); // prompt user for weight of letter let.findPrice(); // find the price of the letter } else if ( mess.equalsIgnoreCase("envelope") == true || mess.equalsIgnoreCase("e") == true ) { Envelope env = new Envelope(); // craeting an instance of Envelope env.askWeight(); // prompt user for weight of envelope env.findPrice(); // find the price of the Envelope } else System.out.println("Please try again, You may have entered in the wrong type or there is no such item available for shipping."); System.exit(0); } }