Collatz
Due: Wed, 1 Feb 2012, 8pm
65 pts, 6.5% of total grade.
Specification
Write a program, individually, to solve the The 3n+1 Problem in Java and C++:
- Sphere
- 4073. The 3n plus 1 problem
- 4765. The 3n plus 1 problem V2 (5 pts of extra credit)
- xkcd
For all projects, the minium requirement for getting a non-zero grade is to satisfy all of the requirements in the table below, including the precise naming of all the files.
For this project, the additional minium requirement for getting a non-zero grade is that Sphere accept your solution in both langauges to 4073 and that you design and implement some form of cache to make it efficient.
You can earn 5 pts of extra credit, if Sphere accepts your solution to 4765.
C++: You may not use new, delete, malloc() or free(). You may use the STL.
Analysis
These are additional descriptions of the underlying math:
Issues and Submission
| Points | Description | Files | Submission | |
|---|---|---|---|---|
| 1 | 5 pts |
Issue Tracker and Wiki Set up a public issue tracker and wiki at Google Project Hosting:
Track the 8 deliverables on this page. Track bugs and features, both open and closed. Categorize, prioritize, and describe each issue adequately. Track at least 5 more issues in addition to the 8 issues on this page. Wiki Describe the design of the algorithm. Write at least 30 lines of description. Use bullet points where appropriate. In general, write grammatically correct, typo free, clear English. Have someone else read what you wrote and critique it. Write neatly. |
Google (public) | |
| 2 | 5 pts |
Private Git Repository Set up a private Git repository at Assembla:
Commit once for each bug or feature. If you cannot describe your changes in a sentence, you are not committing often enough. Write meaningful commit messages and identify the corresponding issue in the issue tracker. Create a log of the commits. Push frequently. It is your responsibility to protect your code from the rest of the students in the class. If your code gets out, you are as guilty as the recipient of academic dishonesty. |
Collatz.log |
Assembla (private) Turnin (zip) |
| 3 | 15 pts |
Unit Tests The grader will set up a public Git repository at Assembla: Write unit tests before your write the code. When you encounter a bug, write a unit test that fails, fix the bug, and confirm that the unit test passes. Write at least 3 unit tests for every function. Tests corner cases and failure cases. Name tests logically. Push and pull the unit tests to and from the grader's repository. Prepend <cs-username>- to the file names at Assembla. Reach consensus on the unit tests. C++: Use Valgrind. |
TestCollatz.c++ TestCollatz.c++.out TestCollatz.java TestCollatz.java.out |
Assembla (private) Assembla (public) Turnin (zip) |
| 4 | 15 pts |
Acceptance Tests Write acceptance tests before your write the code. When you encounter a bug, write an acceptance test that fails, fix the bug, and confirm that the acceptance test passes. Write an auxiliary program to randomly generate acceptance tests. Create at least 1000 acceptance tests. Tests corner cases and failure cases. Push and pull the acceptance tests to and from the grader's repository. Prepend <cs-username>- to the file names at Assembla. Reach consensus on the acceptance tests. C++: Use Valgrind. |
RunCollatz.c++ RunCollatz.in RunCollatz.java RunCollatz.out |
Assembla (private) Assembla (public) Turnin (zip) |
| 5 | 15 pts |
Implementation Use assert to check pre-conditions, post-conditions, argument validity, return-value validity, and invariants. Worry about this last, but your program should run as fast as possible and use as little memory as possible. |
Collatz.h Collatz.java |
Assembla (private) Turnin (zip) |
| 6 | 5 pts |
Documentation C++: Use Doxygen to document the interfaces. Java: Use javadoc to document the interfaces. The above documentation only needs to be generated from Collatz.[h | java]. Comment each function meaningfully. Use comments only if you need to explain the why of a particular implementation. Choose a coding convention and be consistent. Use good variable names. Write readable code with good indentation, blank lines, and blank spaces. |
html-c++/* html-java/* |
Assembla (private) Turnin (zip) |
| 8 | 5 pts |
Google Form Fill out the grader's Google form: |
Google (form) | |
| 8 |
Turnin Submit the project to the grader's Turnin account:
|
<cs-username>-Collatz.zip | Turnin (zip) |