function result = countEvenNumbers(vec)
%countEvenNumbers counts how many even numbers are in a vector
%
%consumes: v, vector of numbers
%produces: result, a scalar number
%
%Examples:
%   >> countEvenNumbers([1 3 5 6])
%   ans = 1
%   >> countEvenNumbers(2:2:8)
%   ans = 4
%   >> countEvenNumbers([1 3 5])
%   ans = 0

  count = 0;
  for k = 1:length(vec)
     if (mod(vec(k),2)==0)
        count = count + 1;
     end % end of if
  end % end of for

  result = count;
end

