//BufferedReader is faster than scanner as it doesn't parse the text. Iterated over 1000 times, it saves 30 seconds in total. import java.io.BufferedReader; import java.io.InputStreamReader; class InternetDelicatessen { public static void main(String[] args) throws java.io.IOException { int amount; float price; float shipping = 0; boolean overnight; System.out.println("Item Name:"); BufferedReader itemI = new BufferedReader(new InputStreamReader(System.in)); String item = itemI.readLine(); System.out.println("Price"); BufferedReader priceI = new BufferedReader(new InputStreamReader(System.in)); price = Float.parseFloat(priceI.readLine()); System.out.println("Overnight Delivery (true or false):"); BufferedReader overnightI = new BufferedReader(new InputStreamReader(System.in)); overnight = Boolean.parseBoolean(overnightI.readLine()); System.out.println("Invoice: "); System.out.println(item + " : $" + price); //Regular Shipping if (price < 10) { shipping = shipping + 2; } else{ shipping = shipping + 3; } //overnight or naw if (overnight) { shipping = shipping + 5; } float total = shipping + price; System.out.println("shipping : $" + shipping); System.out.println("total : $" + total); } } //By msglm; Licensed under the AGPL v3