Object-Oriented Programming

CS371p: Fall 2009: 54850

1. Collatz

Write a program to solve the following UVa problem: The 3n+1 Problem.

Input


As described in UVa.

Ouput


As described in UVa.

Correctness (10 pts)
[no partial credit and required for any other credit]


Your program must produce the correct output from the provided input.
Use Google Groups to reach consensus on the acceptance tests.

A set of CppUnit tests is provided in TestCollatz.h. The provided tests are not guaranteed correct.

Your program must pass the corrected tests. Use Google Groups to reach consensus on the corrected tests.

Additional Correctness (10 pts)


Either get your program accepted without a presentation error by UVa or pass additional acceptance tests created by the grader.

Testing (10 pts)


Create a set of additional CppUnit tests in TestCollatz.h and TestCollatz.out.

Create a set of additional acceptance tests in Collatz.in and Collatz.out.

You must use Valgrind and get no errors.

Design (5 pts)


You must not use new or delete or malloc() or free().

You must use assert() to check pre-conditions, post-conditions, argument validity, return-value validity, and invariants.

You must implement a cache.

Worry about this last, but your program should run as fast as possible and use as little memory as possible.

Documentation (5 pts)


You must edit Collatz.txt with a plain-text editor. Do not use Word!

You must use Google Project’s wiki to document your program.

You must use Doxygen to document interfaces:

  • variables
  • functions
  • classes
  • methods
  • parameters (@param)
  • returns (@return)
  • exceptions (@throws)

You must use C-style (/*…*/) or C++-style (//…) comments to document implementations.

Follow any coding convention, but be consistent. Use good variable names. Write readable code with good indentation, blank lines, and blank spaces.

Source Control (5 pts)


You must use Google Project’s Subversion to manage your files.

Bug Tracking (5 pts)


You must use Google Project’s bug tracker to manage your bugs.

Submission


Every individual must submit the following to Turnin:

Type Name Description
overview Collatz.txt Overview of the submission.

Every pair must submit the following to Google Project:

Type Name Description
documentation html Documentation of the program,
produced by Doxygen.
program main.c++ Definition of the program.
tests TestCollatz.h Definition of the CppUnit tests.
input Collatz.in Input of the program,
acceptance tests.
output Collatz.out Output of the program,
acceptance tests
with Valgrind.
TestCollatz.out Output of the program,
CppUnit tests
with Valgrind.

Every individual must post the following to their UT Blog:

  • predicted number of hours to complete
  • actual number of hours to complete
  • execution time (if accepted)
  • rank (if accepted)
  • Collatz.out (as a page)
  • TestCollatz.out (as a page)

References