First Exercise

The first exercise involves question 2 from the written part of the first test. In question 2, you were given 3 classes: A.java, B.java and C.java.
Here they are:

These 3 classes are used in the program Output.java, which can be found here: In Output.java, you are asked to copy and paste in, one after the other, 16 pieces of code to complete the program, but only after having written in what you think the output will be. These 16 code blocks (a - p) should be considered independently of one another; always delete the previous one before pasting in the new one. And always commit yourself to an answer/output before compiling and running the program with the new code. This gives you a chance to compare what actually happens with what you thought would happen and then try to understand any differences.

You won't submit this exercise. For feedback, ask the TA during the lab if you cannot figure out why Output.java is producing a particular output or ask your instructor in class/office hour. But, of course, try a bit to figure things out first.

Second Exercise

Here is one more array question to try. We'll use the result later in class.

Here is a class of static array methods.

For now there is just one method to print the array (same as exercise 3) and one method to merge two adjacent, sorted sections of an array. That is the method you have to complete and test.

Here is a program with a main() method to help you get started testing your merge() method.

You can submit this program using the following commend:

    % submit 1030 Exercise5 Arrays2.java