Option Strict On Option Explicit On Public Class frmMain Private Sub btnFindSign_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindSign.Click Dim birthday As Date 'Check to see if the date in the textbox is valid If IsDate(txtBirthDay.Text) Then 'stores the value fromt the birthday text box into the variable birthday birthday = CDate(txtBirthDay.Text) 'Call getSign and stores the result into the text box txtSign.Text = getSign(birthday) Else 'Display Error MessageBox.Show("Please Enter a Valid Date", "Invalid Date") End If End Sub 'Function Name: getSign 'Returns: Zodiac sign as a string 'Parameters: inDate of type date 'Description: Takes in a date as and returns the corresponding zodiac sign Function getSign(ByVal inDate As Date) As String 'Gets the day and the month from the incoming date Dim inMonth As Integer = Month(inDate) Dim inDay As Integer = DateAndTime.Day(inDate) Dim sign As String Select Case inMonth Case 1 If inDay < 20 Then sign = "Capricorn" Else sign = "Aquarius" End If Case 2 If inDay < 19 Then sign = "Aquarius" Else sign = "Pisces" End If Case 3 If inDay < 21 Then sign = "Pisces" Else sign = "Aries" End If Case 4 If inDay < 20 Then sign = "Aries" Else sign = "Taurus" End If Case 5 If inDay < 21 Then sign = "Taurus" Else sign = "Gemini" End If Case 6 If inDay < 21 Then sign = "Gemini" Else sign = "Cancer" End If Case 7 If inDay < 23 Then sign = "Cancer" Else sign = "Leo" End If Case 8 If inDay < 23 Then sign = "Leo" Else sign = "Virgo" End If Case 9 If inDay < 23 Then sign = "Virgo" Else sign = "Libra" End If Case 10 If inDay < 23 Then sign = "Libra" Else sign = "Scorpio" End If Case 11 If inDay < 22 Then sign = "Scorpio" Else sign = "Sagittarius" End If Case 12 If inDay < 22 Then sign = "Sagittarius" Else sign = "Capricorn" End If Case Else sign = "Invalid Month" End Select Return sign End Function End Class