1. Write a main method that asks a user for an integer n and then computes the sum of the squares of all the integers from 1 to n, i.e., the sum 12 + 22 + ... + n2. Trace your method on the example of n = 3; the result should be 12 + 22 + 32 = 1 + 4 + 9 = 14.
import java.util.Scanner;
public class Quiz6 {
public static void main(String[] args){
Scanner input = new Scanner(System.in);