public class SmallerMain { public static void main (String[ ] args) { System.out.println (smaller (2.00, 7.15)); } // method main public static double smaller (double price1, double price2) { if (Math.abs (price1 - price2) > Math.min (price1, price2)) throw new ArithmeticException ("difference too large"); return Math.min (price1, price2); } // method smaller } // class SmallerMain