@@ -0,0 +1,1291 @@
+/** Calculates the square root of any double using the Babylonian algorithm.%0A * %0A */%0A%0Apackage babylonianalgorithm;%0A%0A/**%0A *%0A * @author k8port%0A */%0Aimport java.text.DecimalFormat;%0Aimport java.util.Scanner;%0A%0Apublic class BabylonianAlgorithm %7B%0A%0A    /**%0A     * @param args the command line arguments%0A     */%0A  %0A    private static final double PERCENT = 0.01;  // percentage of accuracy for determining number of iterations%0A    %0A    public static void main(String%5B%5D args) %7B%0A        %0A        // declare variables%0A        double r, temp, guess;%0A        Scanner scan = new Scanner(System.in);%0A        DecimalFormat formatter = new DecimalFormat(%22000.00%22); // for formatting ressults %0A        %0A        // gather input from console%0A        System.out.println(%22Enter a number to calculate square root using %22%0A                + %22the babylonian algorithm.%22);%0A        int n = scan.nextInt();%0A        %0A        // calculate algorithm%0A        // repeat loop until result is within 1%25 of previous result%0A        guess = n / 2;%0A        do %7B%0A            temp = guess;%0A            System.out.println(%22iterate%22);%0A            r = n / guess;%0A            guess = (guess + r) / 2;%0A        %7D while ((temp - guess) %3E= (PERCENT * temp));%0A        %0A        System.out.println(formatter.format(guess));%0A        %0A    %7D%0A    %0A%7D%0A

Create BabylonianAlgorithm.java