Lab 23: finally, Writing Files, and More Array Operations


Due Monday, December 4 at 11:59 PM

Goals for This Lab

By the time you have completed this work, you should be able to:

Provided files:

Step-by-Step Instructions

Step 1: Download and Edit WriteArgsToFile.java

This program will take some command-line arguments, and write them to a new file named “args.txt”, one per line. For example, if you run your program with the command-line arguments foo bar baz, it should produce a file named args.txt with the following contents:

foo
bar
baz

The comments in WriteArgsToFile.java provide further details.

Step 2: Download and Edit ArraySplice.java

You need to define a method to splice one array into another array, producing a result array. The comments in ArraySplice.java provide further details.

Step 3: Download ArraySpliceTest.java, and Run the Tests

Run the test suite in ArraySpliceTest.java, which tests the method you wrote in the previous step. All the tests should pass.

Step 4: Turn in Your Solution Using Canvas

Log into Canvas, and go to the COMP 110L class. Click “Assignments” on the left pane, then click “Lab 23”. From here, you can upload your code. Specifically, you must turn in the following two files:

In addition, if you collaborated with anyone else, be sure to download collaborators.txt and write the names of the people you collaborated with in the file, one per line. Please submit this file along with the other two files.

You can turn in the assignment multiple times, but only the last version you submitted will be graded.