initial version cpp and test input file
update answer to problem 2 part(b)