Computer Science 211 |
The lab is described at the end of Chapter 6 in Bailey.
Read Section 6.8 in the text to learn about Comparators. Come to our meeting with a brief description of the sort method that you will write, and ideas for some interesting data to use for the testing of your implementation.
Do the laboratory at the end of Chapter 6.
Please note the following clarifications, modifications, and explanations relating to the lab procedure outlined in the text:
public class MyVector<T> extends structure5.Vector<T>
Keep in mind that as an extension of structure5.Vector, methods of MyVector will have access to instance variables and methods declared as protected in the structure5.Vector implementation. Make good use of this fact!
Important Note: The elementData array in structure5.Vector is declared as private rather than protected for type safety reasons. This means, unfortunately, that MyVector will not be able to access the array directly. Fortunately, Vector has methods that are almost as good as direct access to the array.
You may choose from the data files I have provided in the "labs/comparators" directory in the class shared area. See the README file there for more information. You may also use some other data that you find interesting.
Answer the thought questions at the end of the lab. Include your responses in the README file described below.
When you're finished, create a tar file lab3.tar that includes the following:
Submit lab3.tar by emailing it to jteresco AT mtholyoke.edu as an attachment.
This lab assignment is graded out of 30 points. As in all labs, your grade includes design, documentation, style, and correctness. Be sure to document your program with appropriate comments (use Javadoc!), including your name and a general description at the top of the file, a description of each method with pre and postconditions where appropriate. Also use comments and descriptive variable names to clarify sections of the code which may not be clear to someone trying to understand it.
Grading Breakdown | |
Pre-lab design | 2 points |
Program design | 2 points |
Program style | 3 points |
Program documentation | 5 points |
Program correctness: MyVector | 5 points |
Program correctness: Comparators | 5 points |
Program correctness: sorting applications | 2 points |
"Interestingness" of sorting applications | 2 points |
Thought questions | 4 points |
The program design grade will be based on the design choices you make in the implementation of all of the classes you will submit. The program style grade will be based on code formatting and approriate use of Java naming conventions. The program documentation grade is, of course, based on the comments you provide (including Javadoc and pre and postconditions as appropriate). The program correctness grades are based on how well the different parts of your program meet the functionality requirements.