C++ homework and practice