@@ -0,0 +1,1350 @@
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class Main %7B%0A    // Our limit%0A    private final static int limit = 4000000;%0A    private static List%3CInteger%3E fibSeq;%0A%0A    public Main() %7B%0A%0A    %7D%0A%0A    // Method for iterative calculation of the Fibonacci seq.%0A    public static void fib() %7B%0A        // Init the array%0A        fibSeq = new ArrayList();%0A        // Define var to store our terms (start from 1)%0A        int first = 1, second = 2;%0A        fibSeq.add(first);%0A        fibSeq.add(second);%0A        for (int i = 1; ; i++) %7B%0A            int savePrev1 = first;%0A            first = second;%0A            second = savePrev1 + second;%0A            // Condition from email%0A            if (second %3E= limit) %7B%0A                break;%0A            %7D else %7B%0A                fibSeq.add(second);%0A            %7D%0A            // For testing%0A            //System.out.println(fibSeq);%0A        %7D%0A    %7D%0A%0A    // Method to count sum of the even-valued terms%0A    public static int sumOfEven(List%3CInteger%3E sequences) %7B%0A        int sum = 0;%0A        for (int i : sequences) %7B%0A            if (i %25 2 == 0) %7B%0A                sum += i;%0A            %7D%0A        %7D%0A        return sum;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        fib();%0A        int sumOf = sumOfEven(fibSeq);%0A        System.out.println(%22Sum of the even numbers in sequence= %22 + sumOf);%0A%0A    %7D%0A%7D%0A

Implemented the task