// UTILITY APPLICATION CLASS // Frans Coenen // University of Liverpool // 18 April 2013 class UtilityApp { // ------------------- FIELDS ------------------------ // ------ None ------ // ------------------ METHODS ------------------------ /** Main method to output menu, allow fopr input of selector and processing of selector. */ public static void main(String[] args) { double x = 6.66666; double y = 7.005; double z = 6.33333; // Output System.out.println("Double " + x + " to two decimal places is " + Utility.twoDecPlaces(x)); System.out.println("Double " + y + " to two decimal places is " + Utility.twoDecPlaces(y)); System.out.println("Double " + z + " to two decimal places is " + Utility.twoDecPlaces(z)); // Alternative 1 System.out.println("Alternative 1"); System.out.println("Double " + x + " to two decimal places is " + Utility.twoDecPlacesAlt1(x)); System.out.println("Double " + y + " to two decimal places is " + Utility.twoDecPlacesAlt1(y)); System.out.println("Double " + z + " to two decimal places is " + Utility.twoDecPlacesAlt1(z)); // Alternative 2 System.out.println("Alternative 2"); System.out.print("Double " + x + " to two decimal places is " + Utility.twoDecPlacesAlt2(x)); System.out.print("Double " + y + " to two decimal places is " + Utility.twoDecPlacesAlt2(y)); System.out.print("Double " + z + " to two decimal places is " + Utility.twoDecPlacesAlt2(z)); } }