Update calc.cpp

Updated version with add function