cplusplus final assignment