Homework H11

Due dates

This assignment must be submitted as a single file to the Moodle submission page for Homework H11 by 11:00 PM on Saturday, 12 November.

The assignment

Fix your bugs on Project 9.

Grading

Project 9 was a 50-point assignment. This is a 25-point assignment.

If you don't turn in this homework, you will be given a homework grade equal to one-half of your grade for Project 9.

If you do turn in this homework, it will graded with a rubric similar to that used for Project 9, but you will be guaranteed at least half the points you received on Project 9.

Tests used in Project 9

The files used to test Project 9 are contained in this ZIP file. You should unzip this file in the directory containing your NetBeans project.

Test 0

Test 0 was the input example given in the Project 9 statement.

This is a line
and this one has one Asheville in the middle
  nothing here
This has xAsheville -- should not be printed
  and this with with AshevilleX should not be printed
Asheville starts this one
and this one ends with Asheville
Asheville
    ,Asheville, NC
   Here an Asheville and there an Asheville  every where

the last line

Here's what the output should look like.

and this one has one Raleigh in the middle
Raleigh starts this one
and this one ends with Raleigh
Raleigh
    ,Raleigh, NC
   Here an Raleigh and there an Raleigh  every where

Test 1

Test 1 was the an input file that tested the many ways “Asheville” can appear in the input. Every line in this file matches.

Here's the input.

# 1  Every line matches -- Asheville is surrounded by blanks here
# 2  This line contains Asheville, NC -- with a comma
# 3  There,is,a,punctuation,around,Asheville,in,this,line
# 4  Asheville begins this line
# 5  This line ends with Asheville
# 6  one Asheville two Asheville three Asheville more
# 7  There aren't many Ashevilles, but there is an Asheville in this line!
# 8  This in an 80-character line that has an Asheville in it, abcdefghijklmnopq
# 9  This in an 79-character line that has an Asheville in it, abcdefghijklmnop
#10  This line has Asheville and ends the test without a new line!

Here's the output.

# 1  Every line matches -- Raleigh is surrounded by blanks here
# 2  This line contains Raleigh, NC -- with a comma
# 3  There,is,a,punctuation,around,Raleigh,in,this,line
# 4  Raleigh begins this line
# 5  This line ends with Raleigh
# 6  one Raleigh two Raleigh three Raleigh more
# 7  There aren't many Ashevilles, but there is an Raleigh in this line!
# 8  This in an 80-character line that has an Raleigh in it, abcdefghijklmnopq
# 9  This in an 79-character line that has an Raleigh in it, abcdefghijklmnop
#10  This line has Raleigh and ends the test without a new line!

Test 2

Test 2 was a file with no characters. The output should be the same.

Test 3

Test 3 was a run of the program where there was an argument, but that argument was not a file. The output of the program should be a helpful error message.

Unable to open testNoFile.txt for input

Test 4

In test 4 the program was run with no arguments. The output of the program should mention this.

Insufficient number of arguments