@@ -0,0 +1,1207 @@
+package sumofsquares;%0A%0Aimport java.util.Scanner;%0A%0A/**%0A * Write a short Java method that takes an integer n and returns the sum of the%0A * squares of all positive integers less than or equal to n.%0A *%0A * @author Khav%0A */%0Apublic class SumOfSquares %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner input = new Scanner(System.in);%0A        System.out.print(%22Enter a positive integer : %22);%0A        while (!input.hasNextInt()) %7B%0A            input.nextLine();%0A            System.out.println(%22Wrong input! Enter a positive integer : %22);%0A        %7D%0A        int sum = SumOfSquares(input.nextInt());%0A        if (sum != -1) %7B%0A            System.out.println(%22Sum = %22 + sum);%0A        %7D%0A    %7D%0A%0A    /**%0A     *%0A     * @param n positive integer%0A     * @return sum of the squares of all positive integers less than or equal to%0A     * n.%0A     */%0A    public static int SumOfSquares(int n) %7B%0A        if (n == 1) %7B%0A            return n;%0A        %7D%0A        if (n %3C 1 %7C%7C n == 0) %7B%0A            System.out.println(%22Wrong input! Number should be positive%22);%0A            return -1;%0A        %7D%0A        int sum = 0;%0A        for (int i = 1; i %3C= n; i++) %7B%0A            sum += Math.pow(i, 2);%0A        %7D%0A        return sum;%0A    %7D%0A%0A%7D%0A

Create SumOfSquares.java