Update calc.cpp

Added a square method