Module Module1 Sub Main() REM DAYSOLD.BAS Dim M As Integer Dim D As Integer Dim Y As Integer Console.WriteLine("Enter your birthday") M = Int(Val(Console.ReadLine)) D = Int(Val(Console.ReadLine)) Y = Int(Val(Console.ReadLine)) REM Compute Julian Day Number Dim J As Integer = -Int(7 * (Int((M + 9) / 12) + Y) / 4) Dim S As Integer = Math.Sign(M - 9) Dim A As Integer = Math.Abs(M - 9) Dim J1 As Integer = Int(Y + S * Int(A / 7)) J1 = -Int((Int(J1 / 100) + 1) * 3 / 4) J = J + Int(275 * M / 9) + D + J1 J = J + 1721028 + 367 * Y Do Console.WriteLine("Enter desired age in days") Dim A9 As Integer = Int(Val(Console.ReadLine)) If A9 = 0 Then Exit Do REM Compute calendar date from new JD number Dim J2 As Integer = J + A9 + 1 Dim A1 As Integer = Int((J2 / 36524.25) - 51.12264) A = J2 + 1 + A1 - Int(A1 / 4) Dim B As Integer = A + 1524 Dim C As Integer = Int((B / 365.25) - 0.3343) D = Int(365.25 * C) Dim E As Integer = Int((B - D) / 30.61) D = B - D - Int(30.61 * E) M = E - 1 Y = C - 4716 If E > 13.5 Then M = M - 12 If M < 2.5 Then Y = Y + 1 Console.WriteLine("You will be {0:#####} days old on {1:##}/{2:##}/{3:####}", A9, M, D, Y) Loop REM APPEARED IN COMPUTERS IN REM ASTRONOMY, SKY & TELESCOPE, REM NOVEMBER 2001, PAGE 63 End Sub End Module