Programming Assignment 1
File I/O, Console I/O, and Command-Line Arguments
Code Review for Jade Cheng
Build Results
No errors, no warnings.
Requirements Verification
All source code should be submitted in one file, and that file should be named according to the following pattern: LastFirstX.java
, where Last
is the student’s last name, First
is the student’s first name, and X
is the assignment number.
For example, student John Doe
would submit DoeJohn3.java
for programming assignment 3.
PASS.
The first lines of the submitted file should include a comment with the following information and format:
/** * A short description of the program. * * @author Last Name, First Name * @assignment CSCI 2912 Assignment X * @date Date */
PASS.
PASS.
The subject line of the email sent to the instructor should follow the pattern: [2912] assignment number
.
For example, for assignment 3, student John Doe would write “[2912] assignment 3
” as the subject line of his submission email.
PASS.
PASS.
PASS.
PASS.
PASS.
PASS.
This is the first line. This is the second line. This is the third line. This is the fourth line....then the application writes the following output if the user specifies sample-input.txt on the command line:
[sample-input.txt] 1: This is the first line. 2: This is the second line. 3: This is the third line. 4: This is the fourth line.
PASS.
PASS.
PASS.
PASS.
PASS.
exit
, the application terminates; otherwise, the application interprets the line as a path to a text file.PASS.
PASS.
PASS.
Enter a file name or type 'exit' to quit. -->
PASS.
PASS.
PASS.
PASS.
Sample Execution
$ java ChengJade1 input-1.txt input-2.txt [input-1.txt] 1: This is line one. 2: This is line two. 3: This is line three. 4: This is line four. 5: This is line five. [input-2.txt] 1: This is line one. 2: This is line two. 3: This is line three. 4: This is line four. 5: This is line five. 6: This is line six. 7: This is line seven. Enter a file name or type 'exit' to quit. --> output-1.txt [output-1.txt] 1: output-1.txt 2: Sun Feb 12 04:20:56 HST 2012 Enter a file name or type 'exit' to quit. --> output-2.txt [output-2.txt] 1: output-2.txt 2: Sun Feb 12 04:20:57 HST 2012 Enter a file name or type 'exit' to quit. --> exit $ java ChengJade1 missing.txt [missing.txt] missing.txt (The system cannot find the file specified) Enter a file name or type 'exit' to quit. --> exit $ java ChengJade1 Enter a file name or type 'exit' to quit. --> exit $ java ChengJade1 . [.] . (Access is denied) Enter a file name or type 'exit' to quit. --> . . (Access is denied) Enter a file name or type 'exit' to quit. --> exit $ java ChengJade1 < /dev/null Enter a file name or type 'exit' to quit. -->