static int yearsToDays(int years) { int days = 0; for (int year = 0; year < years; year++) { days += isLeapYear(year) ? 366 : 365; } return days; }