leapYear method

bool leapYear(
  1. int year
)

Given a year, return true if it's a leap year, false otherwise.

Args: year (int): the year to check

Implementation

bool leapYear(int year) {
  bool leapYear = false;
  bool leap = ((year % 100 == 0) && (year % 400 != 0));
  if (leap == true)
    leapYear = false;
  else if (year % 4 == 0) leapYear = true;

  return leapYear;
}