Consider the sequence defined by
g(0) = first command line argument
g(1) = second command line argument
g(i) = the absolute value of g(i-1) - g(i-2)
Complete the class definition
class AbsoluteDifferenceSequence {
public static void main(String[] args) {
/* the method
public static int Integer.parseInt(String s)
returns its argument s interpreted as an integer */
/* the method
public static int Math.abs(int i)
returns the absolute value of its argument i */
}
}
printing the first n elements of this sequence, where n is the
third command line argument. For example,
java AbsoluteDifferenceSequence 2 200 10
should print out the following ten lines.
2
200
198
2
196
194
2
192
190
2