daysLeftInYear method
It returns the number of days left in the year.
Args: monthNum (int): The number of the month (1-12) dayNum (int): The day of the month (1-31) year (int): The year in question.
Implementation
int daysLeftInYear(final int monthNum, final int dayNum, final int year) {
var totalMonthLength = 0;
for (var count = 1; count < monthNum; count++) {
totalMonthLength += daysInMonth(count, year)!;
}
return totalMonthLength + dayNum - daysInYear(year);
}