|
|||||
Home |
Resources | Homeworks |
Exams |
In an effort to reduce the TA grading load, and thus ensure timely return of the various graded assignments, this lab quiz was graded automatically. Another program was run, and conducted a series of 21 tests of the quiz 3 code. Each test was worth 2.5 points. The tests are described below.
Tests PerformedTests of indexOf()Ten elements were inserted into the vector: 10, 20, 30, 40, 50, 10, 20, 30, 40, and 50
Tests of lastIndexOf()The vector contained the same 10 elements from the previous tests
Tests of clear()Five elements were inserted into the vector: 10, 20, 30, 40, and 50. Whether the vector was empty or not was determined by calling the size() method, which was provided in the skeleton code.
Tests of addAt()For the first three tests, the vector is initially empty. For the last 7 tests the vector contained the numbers 10, 20, 30, 40, and 50. The vector was re-created before each test. The contents of the vector after each test is shown at the end of the line in square brackets. Note that the word 'where' in the test means the parameter 'where' that was passed into the addAt() method.
Sample OutputThis is a sample output from a program that does everything correctly. A failed test will print the word FAILED in all capital letters, along with the point penalty (-2.5 points per test failed). Testing the MiniVector class from the third lab quiz Testing indexOf()... Found the correct first position of element 10 in the MiniVector: passed Found the correct first position of element 30 in the MiniVector: passed Found the correct first position of element 50 in the MiniVector: passed Returned -1 for element not found in MiniVector: passed Testing lastIndexOf()... Found the correct last position of element 10 in the MiniVector: passed Found the correct last position of element 30 in the MiniVector: passed Found the correct last position of element 50 in the MiniVector: passed Returned -1 for element not found in MiniVector: passed Testing clear()... MiniVector is not empty prior to clear: passed MiniVector is empty after clear: passed Added 5 elements after clear(); is the same as after adding the 3 elements before clear: passed Testing addAt()... 0: correctly adds element to empty mv when where == 0: passed 1: correctly adds element to empty mv when where > 0: passed 2: correctly adds element to empty mv when where > array size: passed 3: correctly adds element to non-empty vector at the beginning (where == 0): passed 4: correctly adds element to non-empty vector towards the beginning (where == 1): passed 5: correctly adds element to non-empty vector in the middle (where > 0 && where < length-1): passed 6: correctly adds element to non-empty vector at the end (where == length-1): passed 7: correctly adds element to non-empty vector at the end (where == length): passed 8: correctly adds element to non-empty vector beyond the end (where > length): passed 9: correctly adds element to non-empty vector beyond the end (where > array size): passed Student's final grade is: 100
|