Updated p2.cpp

test cases, functions 'sum' through 'rotate' implemented