Results 1 to 3 of 3

Thread: How to simulate voting vb.net ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    12

    Angry How to simulate voting vb.net ?

    i want to users to be able to vote for their favourite soft drink. They will input the names of the soft drinks through the use of an inputbox, the names input are stored in an array.

    what i would like to do is count the votes given to each soft drink. How would this be done, please provide example code if possible. thanks

    p.s. i tried using a listbox and failed.

    Well during the set up of the program they will input the names of all soft drinks up for voting, and then all the soft drinks input wll be displayed in a list when the voting take place.

    It is not a homework
    Last edited by asif786; Feb 15th, 2009 at 06:20 PM.

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: How to simulate voting vb.net ?

    It kind of sounds like homework, but heres a nudge in the right direction.
    I'd use a Dictionary(Of String, Integer). When the user enters the name of a soft drink, you should check if a key exists with that name, and increment its value by 1 if it does. If it does not exist, add it to the dictionary with a value of 1.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: How to simulate voting vb.net ?

    So do you give a list and then people click on their favorite?, or do they type in the name of their favorite?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width