Hello, I'm looking for some help on the following program.
The program generally should follow this concept
Create a program name Sequence.java which accepts an integer input from com-
mand line and outputs “found” if the input is found in sequence array and “not
found” otherwise. You need to define sequence to be of type array of int and
statically initialize it as follows:
int[] sequence = { 2,3,4,10,-11,25,31,-21, 14, 18, 131, 99, 721, 23, 44, 802, 820,
-603, 102, 53, 64, -912, 1201, 3001 };
Here is the code i wrote
public static void main(String[] args) {
int[] seq = {2, 3, 4, 10, -11, 25, 31, -21, 14, 18, 131, 99, 721, 23, 44, 802, 820, -603, 102, 53, 64, -912, 1201, 3001};
int input = Integer.parseInt(args[0]);
if (input == seq.length)
System.out.println("Found");
else
System.out.println("Not Found");
}
}