@@ -0,0 +1,1856 @@
+/**%0A *   This class is used to determine whether two floating-point numbers are the same%0A *   when rounded to a given number of decimal places.%0A */%0Aimport javax.swing.JOptionPane;%0A%0Apublic class DoubleCompare %7B%0A    /** %3E%3E%3E%3E complete this method %3C%3C%3C%3C%3C%3C%0A     *  Method to test the equality of the two inputs.%0A     *  @param num1 is the first number%0A     *  @param num2 is the second number%0A     *  @param places is the number of places AFTER the decimal point%0A     *  @return true if the two numbers are the same up to the given%0A     *  number of places, else return false%0A     */%0A    public static boolean isSameNumber(double num1, double num2, int places) %7B%0A        double multiplicationConstant = Math.pow(10, places);%0A        double num1Rounded = Math.round(num1 * multiplicationConstant),%0A               num2Rounded = Math.round(num2 * multiplicationConstant);%0A        return num1Rounded == num2Rounded;%0A    %7D%0A%0A%0A    public static void main(String%5B%5D args) %7B%0A        /**%0A         * Get keyboard input from the user using JOptionPane%0A         * Have the user enter two decimal numbers and a number of decimal places to compare%0A         * Print the results in a nicely formatted output a statement%0A         *%0A         * examples:%0A         *     isSameNumber(3.45,3.44,1) ---%3E false%0A         *     isSameNumber(3.45,3.44,0) ---%3E true%0A         *     isSameNumber(1.9999,2.0009,3) ---%3E false%0A         *     isSameNumber(1.9999,2.0009,2) ---%3E true%0A         */%0A        double num1 = Double.parseDouble(JOptionPane.showInputDialog(null, %22Enter the first number%22));%0A        double num2 = Double.parseDouble(JOptionPane.showInputDialog(null, %22Enter the second number%22));%0A        int places = Integer.parseInt(JOptionPane.showInputDialog(null, %22Enter the number of decimal places of accuracy%22));%0A%0A        System.out.println(isSameNumber(num1, num2, places));%0A    %7D%0A%7D%0A

Create DoubleCompare.java