C++ Assignment sample code