Public Class frmAge

  Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
    Dim prompt, title, fullName, firstName As String
    Dim dayOfBirth As Date
    prompt = "Enter your full name."
    title = "Name"
    fullName = InputBox(prompt, title)
    firstName = fullName.Substring(0, fullName.IndexOf(" "))
    prompt = "Enter your date of birth."
    title = "Birthday"
    dayOfBirth = CDate(InputBox(prompt, title))
    txtOutput.Text = firstName & ", you are " &
             DateDiff(DateInterval.Day, dayOfBirth, Today) & " days old."

  End Sub

End Class
