CS 202 Fall 2013  >  In-Class Challenge for Tuesday, September 24, 2013

CS 202 Fall 2013
In-Class Challenge for Tuesday, September 24, 2013

This challenge deals with a C++ class CountMe. It is initially specified as follows. What you are actually to do is found below.

Class CountMe Initial Specification

What to Do

Do as many of the following as you can before class ends. After each, please show me your work.

  1. Write a minimal version of files countme.h and countme.cpp that compile with the test program test_countme.cpp.
  2. Implement class CountMe as above, so that all tests pass.
  3. Add an additional option to the class: keep track of how many constructor calls and how many destructor calls there have been for class CountMe. Write a program that demonstrates this functionality. The resulting class should still compile with the test program and pass all tests.


CS 202 Fall 2013: In-Class Challenge for Tuesday, September 24, 2013 / Updated: 24 Sep 2013 / Glenn G. Chappell