Welcome to Dream.In.Code
Become a VB Expert!

Join 149,485 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,346 people online right now. Registration is fast and FREE... Join Now!




VB.NET...voting system

 
Reply to this topicStart new topic

VB.NET...voting system, cannot get the result

ladylike
28 Apr, 2007 - 12:34 AM
Post #1

New D.I.C Head
*

Joined: 28 Apr, 2007
Posts: 2


My Contributions
diz is my voting system coding..after i'd run it..the result is weird..can sum1 help me to enhance diz coding?..thnx you


CODE
Public Class Main

    
    'variables to store votes for best male student
    Dim shtHadiCount As Short
    Dim shtFikreeCount As Short
    Dim shtWenCount As Short
    Dim shtHishamCount As Short
    Dim shtSaufiCount As Short


    'variables to store votes for best female student
    Dim shtIliCount As Short
    Dim shtAnisCount As Short
    Dim shtRohayaCount As Short
    Dim shtShaminiCount As Short
    Dim shtYasminCount As Short

    'variables to store votes for best international male student
    Dim shtEhabCount As Short
    Dim shtAhmedCount As Short
    Dim shtIvanCount As Short
    Dim shtLimCount As Short
    Dim shtThetCount As Short

    'variables to store votes for best international female student
    Dim shtHongCount As Short
    Dim shtVuCount As Short
    Dim shtKasmaCount As Short
    Dim shtSarunCount As Short
    Dim shtDoCount As Short


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    End Sub

    Private Sub btnVote_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVote.Click
        'Process Best Male Student vote
        Select Case cboMale.SelectedItem
            Case "ABDUL HADI BIN ALIAS"
                shtHadiCount += 1
            Case "AHMAD FIKREE BIN KAMIL"
                shtFikreeCount += 1
            Case "CHAN WEN KIAT"
                shtWenCount += 1
            Case "HISHAM BIN OSMAN"
                shtHishamCount += 1
            Case "SAUFI BIN ALI"
                shtSaufiCount += 1
        End Select
        cboMale.SelectedItem = -1 'Reset the combo box to unselected

        'Process Best Female Student vote
        Select Case cboFemale.SelectedItem
            Case "ILI NABILAH NASIR"
                shtIliCount += 1
            Case "NUR ANIS BINTI NOR AZLAN"
                shtAnisCount += 1
            Case "ROHAYA BINTI RAMLI"
                shtRohayaCount += 1
            Case "SHAMINI A/P SRIDARAN"
                shtShaminiCount += 1
            Case "YASMIN BINTI KHAMIS"
                shtYasminCount += 1
        End Select
        cboFemale.SelectedItem = -1 'Reset the combo box to unselected

        'Process Best International Male Student vote
        Select Case cboMaleInt.SelectedItem
            Case "AHMED EHAB MOHAMED ZAGHLOUL"
                shtEhabCount += 1
            Case "AHMED MOHAMED SAAD"
                shtAhmedCount += 1
            Case "IVAN SYLVESTER GOMEZ"
                shtIvanCount += 1
            Case "LIM BOREY"
                shtLimCount += 1
            Case "THET SAN"
                shtThetCount += 1
        End Select
        cboMaleInt.SelectedItem = -1 'Reset the combo box to unselected

        'Process Best International Female Student vote
        Select Case cboMaleInt.SelectedItem
            Case "NGUYEN HONG NHUNG"
                shtHongCount += 1
            Case "VU PHUONG ANH"
                shtVuCount += 1
            Case "TUAN KASMA"
                shtKasmaCount += 1
            Case "SARUN MUNSEILA"
                shtSarunCount += 1
            Case "DO KIM DIEU"
                shtDoCount += 1
        End Select
        cboFemaleInt.SelectedItem = -1 'Reset the combo box to unselected
    End Sub

    Private Sub btnResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResult.Click
        'Best Male Student
        cboMale.Items(0) &= " (" & shtHadiCount & ")"
        cboMale.Items(1) &= " (" & shtFikreeCount & ")"
        cboMale.Items(2) &= " (" & shtWenCount & ")"
        cboMale.Items(3) &= " (" & shtHishamCount & ")"
        cboMale.Items(4) &= " (" & shtSaufiCount & ")"

        cboFemale.Items(0) &= " (" & shtIliCount & ")"
        cboFemale.Items(1) &= " (" & shtAnisCount & ")"
        cboFemale.Items(2) &= " (" & shtRohayaCount & ")"
        cboFemale.Items(3) &= " (" & shtShaminiCount & ")"
        cboFemale.Items(4) &= " (" & shtYasminCount & ")"

        cboMaleInt.Items(0) &= " (" & shtEhabCount & ")"
        cboMaleInt.Items(1) &= " (" & shtAhmedCount & ")"
        cboMaleInt.Items(2) &= " (" & shtIvanCount & ")"
        cboMaleInt.Items(3) &= " (" & shtLimCount & ")"
        cboMaleInt.Items(4) &= " (" & shtThetCount & ")"

        cboFemaleInt.Items(0) &= " (" & shtHongCount & ")"
        cboFemaleInt.Items(1) &= " (" & shtVuCount & ")"
        cboFemaleInt.Items(2) &= " (" & shtKasmaCount & ")"
        cboFemaleInt.Items(3) &= " (" & shtSarunCount & ")"
        cboFemaleInt.Items(4) &= " (" & shtDoCount & ")"



    End Sub

End Class

User is offlineProfile CardPM
+Quote Post

Amadeus
RE: VB.NET...voting System
28 Apr, 2007 - 11:14 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,349



Thanked: 51 times
Dream Kudos: 25
My Contributions
Can you elaborate on what you mean by 'the result is wierd'? Please include a description of what the input is, the actual output, the desired output, and any error messages that may be generated.

Thank You.
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 04:47PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month