Write a recursive method definition for the following method:
/**
Precondition: n >= 1
Returns the sum of the squares of the numbers 1 through n.
*/
public static int squares(int n)
For example, squares(3) returns 14 because 12 + 22 + 32 is 14.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here