Calculate function made only for numeric type and object class used to hide the logic from main.rb