solutions to 1.1 through 1.3 added for c++