CSC415 C++ exercise