Answer to Question #12878 in Visual Basic for Han

Question #12878
need to create a program that will input the Month and day..
the result should be number of number of day, day is and zodiac sign...
1
Expert's answer
2012-08-09T11:47:16-0400
Module Module1
Private numberofnumberofday As Integer = 0
Sub Main()
Dim pMonth As Integer
Dim pDay As Integer
Console.Write("Enter Month: ")
pMonth = Integer.Parse(Console.ReadLine())
Console.Write("Enter Day: ")
pDay = Integer.Parse(Console.ReadLine())
Horoscope(pMonth, pMonth)
Console.Write("Number of number of day is: " + numberofnumberofday.ToString() + ", zodiac sign is: " + Horoscope(pMonth,
pMonth))
Console.ReadLine()
End Sub
Private Function Horoscope(ByVal pMonth As Integer, ByVal pDay As Integer) As String

If pMonth = 3 Then
If pDay >= 21 Then 'And pDay <= 31 Then
Horoscope = "Aries"
Else
Horoscope = "Pisces"
End If
numberofnumberofday = 31
ElseIf pMonth = 4 Then
If pDay >= 20 Then 'And pDay <= 30 Then
Horoscope = "Taurus"
Else
Horoscope = "Aries"
End If
numberofnumberofday = 30
ElseIf pMonth = 5 Then
If pDay >= 21 Then 'And pDay <= 31 Then
Horoscope = "Gemini"
Else
Horoscope = "Taurus"
End If
numberofnumberofday = 31
ElseIf pMonth = 6 Then
If pDay >= 22 Then 'And pDay <= 30 Then
Horoscope = "Cancer"
Else
Horoscope = "Gemini"
End If
numberofnumberofday = 30
ElseIf pMonth = 7 Then
If pDay >= 23 Then 'And pDay <= 31 Then
Horoscope = "Leo"
Else
Horoscope = "Cancer"
End If
numberofnumberofday = 31
ElseIf pMonth = 8 Then
If pDay >= 23 Then 'And pDay <= 31 Then
Horoscope = "Virgo"
Else
Horoscope = "Leo"
End If
numberofnumberofday = 31
ElseIf pMonth = 9 Then
If pDay >= 23 Then 'And pDay <= 30 Then
Horoscope = "Libra"
Else
Horoscope = "Virgo"
End If
numberofnumberofday = 30
ElseIf pMonth = 10 Then
If pDay >= 23 Then 'And pDay <= 31 Then
Horoscope = "Scorpio"
Else
Horoscope = "Libra"
End If
numberofnumberofday = 31
ElseIf pMonth = 11 Then
If pDay >= 22 Then 'And pDay <= 30 Then
Horoscope = "Sagittarius"
Else
Horoscope = "Libra"
End If
numberofnumberofday = 30
ElseIf pMonth = 12 Then
If pDay >= 22 Then 'And pDay <= 31 Then
Horoscope = "Capricorn"
Else
Horoscope = "Sagittarius"
End If
numberofnumberofday = 31
ElseIf pMonth = 1 Then
If pDay >= 20 Then 'And pDay <= 31 Then
Horoscope = "Aquarius"
Else
Horoscope = "Capricorn"
End If
numberofnumberofday = 31
Else 'If pMonth = 2 Then
If pDay >= 19 Then 'And pDay <= 29 Then
Horoscope = "Pisces"
Else
Horoscope = "Aquarius"
End If
numberofnumberofday = 28
End If
End Function
End Module

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS