The Question

Write a java program called Q1.java. It should read in a sequence of lines of input. Each line consists of two ints separated by one or more blanks. Think of the 2 ints as belonging to 2 lists. (Assume that the input is in the correct format.) It should then print out, one per line, sorted from smallest to largest, with no repetitions, those ints that appears in one list only, but not in both. Before printing out these ints, it should print out a dashed line to visually separate output from input.

The output should conform to that in the sample run of a correct program shown below. Note that, in this sample run, the % sign is not part of the program output.

Sample Run

%
% java Q1
Enter lines of input containing 2 ints each:
5  4
1  3
2  7
2  1
3  4
4  1
----------
2
5
7
%

Useful APIs

Here (again) are the common APIs that you may access:

Java 1.5 API
Type API

Submitting Your Work

Here is the command to submit your work (further details regarding the submit command can also be obtained by typing man submit
Once again, you are encouraged to submit regularly. Newer submissions overwrite older ones.

submit 1020 labtest3F1 Q1.java