C++ lab exercise