Link to home
Start Free TrialLog in
Avatar of karmicrepublic
karmicrepublic

asked on

Calculate A Persons Age

How do i compute a persons age? if there's a leap year?
Avatar of Glen A.
Glen A.
Flag of United States of America image

ASKER CERTIFIED SOLUTION
Avatar of Glen A.
Glen A.
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sudhakar_koundinya
sudhakar_koundinya

test for leap year

Public Function IsLeapYear(Yr As Integer) As Boolean

'Set default return value
IsLeapYear = False
      
'If year is divisible with four then it's a leap year, unless
'is divisible by 100 but not by 400...
If Yr Mod 4 = 0 Then

      IsLeapYear = True

      If Yr Mod 100 = 0 Then

            If (Yr Mod 400) Then IsLeapYear = False

      End If

End If

End Function
Why the 'B' grade?  I supplied two working links and one with source code.