Programs for a C++ class