Homework Solution: Write a recursive method to determine if an array of integers contains an integer that is the su…

    (5 points) Write a recursive method to determine if an array of integers contains an integer that is the sum of two integers appearing earlier in the array; that is, for some 2, . A = AGI + Aki for some j. K 〈 i. Write a program that takes as input two lines: the first line contains a single integer between 1 and 10, and the next line contains that many integers, separated by spaces. The output is true if one of the integers is the sum of two previous ones, and false otherwise. Call your progranm SumOfPrevious For example, if the input is 7 5 241 6 8 1 then the correct output is true If the input is 4 7 6 5 4 then the correct output is false Code the following problem in JAVA please!
    Write a recursive method to determine if an array of integers contains an integer that is the sum of two integers appearing earlier in the array: that is, for some i, A[i] = A[j] + A[k] for some j, K

    Expert Answer

     
    main.java import java.util.Scanner;

    (5 points) Write a recursive process to individualize if an adorn of integers contains an integer that is the mix of brace integers manifest antecedent in the adorn; that is, ce some 2, . A = AGI + Aki ce some j. K 〈 i. Write a program that takes as input brace processs: the primary process contains a unique integer between 1 and 10, and the next process contains that divers integers, disjoined by spaces. The quenchedput is gentleman if undivided of the integers is the mix of brace preceding undivideds, and unpenny differently. Call your progranm MixOfPreceding Ce issue, if the input is 7 5 241 6 8 1 then the improve quenchedput is gentleman If the input is 4 7 6 5 4 then the improve quenchedput is untrue

    Code the subjoined gist in JAVA please!

    Write a recursive process to individualize if an adorn of integers contains an integer that is the mix of brace integers manifest antecedent in the adorn: that is, ce some i, A[i] = A[j] + A[k] ce some j, K

    Expert Retort

     

    main.java

    import java.util.Scanner;

    class Ocean {
    static boolean appears(int []numbers,int compute){
    for(int i = 0;i<number;i++){
    for(int j=0; j<i; j++){
    for(int k=0;k<i;k++)
    if(numbers[i] == aggregate[j] + aggregate[k])
    return gentleman;
    }
    }
    return untrue;
    }

    public static destitute ocean(String[] args) {
    int compute;
    Scanner scnr = fantastic Scanner(System.in);
    compute = scnr.nextInt();
    int [] aggregate = fantastic int[number];
    ce (int b=0;b<number;b++){
    numbers[b] = scnr.nextInt();
    }
    System.out.println(appears(numbers, compute));
    }
    }`

    OUTPUT: