finally
, Writing Files, and More Array OperationsDue Monday, December 4 at 11:59 PM
By the time you have completed this work, you should be able to:
finally
to make an action occur whether or not an exception is thrownBufferedWriter
and FileWriter
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.
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.
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.
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:
WriteArgsToFile.java
ArraySplice.java
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.