function result = isLeapYear(year)
%isLeapYear returns whether year is a leap year or not
%
% consumes: year, a scalar number
%  
% produces: boolean (true if year is a leapyear)
%
%
% examples:
%        >> isLeapYear(2006)
%        ans = false
%        >> isLeapYear(2004)
%        ans = true
%        >> isLeapYear(2000)
%        ans = true
%        >> isLeapYear(1900)
%        ans = false
%        >> isLeapYear(2003)
%        ans = false
 
if (mod(year,4)==0) && (mod(year,100)~=0)
  result = true;
else if mod(year,400)==0
  result = true;
else
  result = false;
end;

return;
end
