@@ -0,0 +1,1381 @@
+import javax.swing.JOptionPane; // import a package for user input%0A%0Apublic class DogYears%0A%7B%0A    /*****%0A     * Complete the method to calculate dog years%0A     *%0A     * Add 10.5 for each of the first two years%0A     *   then for each additional year:%0A     * for small or medium sized dogs add 4%0A     * for large dogs add 5%0A     * for giant breeds add 6%0A     ****/%0A    public static double calculateYears(String size, int yrs)%0A    %7B%0A        if (yrs %3C= 2) return 10.5*yrs;%0A        else %7B%0A            // First 2 years%0A            yrs -= 2;%0A%0A            int sizeConstant;%0A            if (size .equals(%22small%22) %7C%7C size.equals(%22medium%22)) sizeConstant = 4;%0A            else if (size.equals(%22large%22)) sizeConstant = 5;%0A            else if (size.equals(%22giant%22)) sizeConstant = 6;%0A            else sizeConstant = 0;%0A%0A            return yrs * sizeConstant + 21;%0A        %7D%0A    %7D%0A%0A    // The main method is complete%0A    public static void main( String args%5B%5D )%0A    %7B%0A        /*** Read a string into variable dogSize ***/%0A        String dogSize = JOptionPane.showInputDialog(null, %22Enter the dog's size: small, medium, large, giant.%22);%0A%0A        /*** Read an integer into variable dogAge ***/%0A        int dogAge = Integer.parseInt(JOptionPane.showInputDialog(null, %22Enter the dog's age.%22));%0A%0A        System.out.println(%22The dog%E2%80%99s age in human years is %22 +  calculateYears(dogSize,dogAge));%0A    %7D%0A%7D%0A

Create DogYears.java