Example Report

Hi everybody,

I've copied an example of the program test report for assignment 6 below. Some of you had trouble getting your programs to work well. Please have a look at the output of this assignment. Please also let me know if you need an example implementation.

This time, I won't include the contents of the files that I used to test your programs because they are very clear from the output. Note that for this assignment, some of us did not correctly implement Iterator. Instead the contents were printed out by looping through the collection using an index. In that case, the test report would look correct, but I'll take off a relatively large portion of the sore since the main purpose of this assignment was to understand the implementation of the Iterator.

If you submitted your assignment 6, you will soon receive an email from me with your report and score. If you haven't received the email by late tonight, let me know. Also let me know if you have any questions regarding your score.


Here is your score for Assignment 6.

Score: TBD%

Let me know if you have any questions regarding your score. And let me know if you want a copy of an example implementation for the assignment.


Grading Guildelines

Test Results

% java ChengJade6 Sample.txt
The size of the collection is: 3 3: bar 3: foo 11: Hello world
% java ChengJade6 Empty.txt
The size of the collection is: 0
% java ChengJade6 Assignment.txt
The size of the collection is: 49 6: 3: bar 15: 11: Hello world 6: 3: foo 26: The collection has 3 items 0: 45: lines as follows (the size is printed first): 0: 44: It would be OK for your program to print the 0: 3: bar 3: foo 11: Hello world 0: 60: For example, if the file contains the following three lines: 0: 15: the collection. 66: order different from the sequence in which the lines were added to 67: It is OK if the iterator for the collection returns the lines in an 0: 27: of characters in that line. 68: stored in the collection, and print each line preceded by the number 65: The main method then uses the iterator to read back all the lines 0: 44: number of elements stored in the collection. 63: main method must print the size of the collection, that is, the 65: Once the lines in the file have been added to the collection, the 0: 41: and insert each line into the collection. 68: read one line at a time from a file (specified on the command line), 67: new collection class object parametrized with the type String, then 67: to test the collection class itself. This main method must create a 68: As part of your collection class, you should implement a main method 0: 61: objects it can hold, make sure that number is at least 1,000. 62: type T. If your collection class has a fixed maximum number of 68: Be sure your collection class is generic, that is, parametrized on a 68: linked list (at your choice) to store the objects in the collection. 66: You may implement your collection class using either an array or a 0: 46: needs to support the next and hasNext methods. 68: simply throw the appropriate exception, so your iterator only really 68: your collection class). The remove method must be present but should 67: implements the Iterator interface (you define this class as well as 67: The object returned by your iterator method must be of a class that 0: 24: defined for Collections. 64: the Collection interface, but need not support any other methods 65: class must provide the add, iterator, and size methods defined in 64: In this assignment, you implement a class with an iterator. Your
% java ChengJade6
Usage: ChengJade6 path
% java ChengJade6 BadPath.txt
Unable to open the file.
% java ChengJade6 BadPath1.txt BadPath2.txt
Usage: ChengJade6 path
Valid HTML 4.01 Valid CSS