Update calc.cpp

added new method