Computer Science 211 |
First, carefully read the lab description in the text and this handout. You will have questions, so be sure to leave plenty of time to discuss this assignment with me and the TAs.
Next, develop a sketch of the BestOf class. What does it extend and/or implement? What instance variables are needed? Do you plan to store its contents in order? Why or why not?
No later than Monday, November 2, please either see me to go over your sketch of this class or email it to me for comment and discussion (for 3 points).
You should maintain two BestOfs for this program, one responsible for each above the parts above.
Write this program as a main method to a class Syracuse in a file Syracuse.java. Should you need to use an extra class to keep track of information for the Syracuse sequence generation, you can declare a non-public class inside of Syracuse.java that can be used only within that Java file. See the MazeRunner program for examples of these non-public classes.
The intermediate values you will generate can get quite large, so to be safe, use values of type long and Long instead of int and Integer as you generate your sequences.
When you are finished, please submit the following by email to jteresco AT mtholyoke.edu:
This lab assignment is graded out of 30 points. As in all labs, you will be graded on 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 | 3 points |
Program design | 2 points |
Program style | 2 points |
Program documentation | 5 points |
BestOf correctness | 8 points |
BestOf test case | 2 points |
Syracuse correctness | 4 points |
Thought questions (1 and 2) | 4 points |
The program design grade will be based on the design choices you make in the implementation of the BestOf class. 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 grade is based on how well your program meets the functionality requirements.