Sub LeapYear(Year As Int) As Boolean
If Year Mod 4 <> 0 Then Return False
If Year Mod 400 = 0 Then Return True
If Year Mod 100 = 0 Then Return False
Return True
End Sub
Sub DaysOfMonth(Year As Int, Month As Int) As Int
Select Month
Case 2
If LeapYear(Year) Then Return 29 Else Return 28
Case 4, 6, 9, 11
Return 30
Case Else
Return 31
End Select
End Sub