Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

View Poll Results: which Programming Langugaes do you guys like??
C++ 4 44.44%
Visual Basic 3 33.33%
Java 2 22.22%
Other 0 0%
Voters: 9. You may not vote on this poll

Closed Thread
 
Thread Tools Display Modes
Old Jun 5th, 2008, 2:20 PM   #11
~The~ICE~Man~
Programmer
 
Join Date: Feb 2008
Location: Canada
Posts: 17
Rep Power: 0 ~The~ICE~Man~ is on a distinguished road
Send a message via MSN to ~The~ICE~Man~ Send a message via Yahoo to ~The~ICE~Man~
Re: Creating a Zodiac Sign Program in Visual Basic

Try this I made it a few months ago worked great

Private Sub dtpBirthDate_Change()
lblAstro.Caption = Horoscope(dtpBirthDate.Value)
End Sub

Private Function Horoscope(pBirthDate As Date) As String
Dim pMonth As Integer
Dim pDay As Integer
pMonth = Month(pBirthDate)
pDay = Day(pBirthDate)

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

Private Sub Form_Load()
dtpBirthDate.Value = Date
lblAstro.Caption = Horoscope(dtpBirthDate.Value)
End Sub
~The~ICE~Man~ is offline  
Old Feb 3rd, 2011, 10:55 AM   #12
~The~ICE~Man~
Programmer
 
Join Date: Feb 2008
Location: Canada
Posts: 17
Rep Power: 0 ~The~ICE~Man~ is on a distinguished road
Send a message via MSN to ~The~ICE~Man~ Send a message via Yahoo to ~The~ICE~Man~
Re: Creating a Zodiac Sign Program in Visual Basic

Thanks I will check it out
~The~ICE~Man~ is offline  
Closed Thread

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic to java HELP! araujo2nd Visual Basic .NET 1 Feb 13th, 2008 9:36 AM
Visual Basic 2005 Express Edition For Dummies ReubenK Book Reviews 3 Jul 31st, 2007 8:47 AM
Plz Help - Visual Basic .net/visual C++ .net Code VBuser C++ 14 Jan 22nd, 2007 9:54 AM
visual basic pixel image comparison youngnoviceinneedofhelp Visual Basic 3 Mar 19th, 2006 1:57 PM
Creating a program to test a program sixstringartist C 8 Jan 21st, 2006 1:15 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:40 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC