Results 1 to 8 of 8

Thread: [RESOLVED] [02/03] geting the average grade using listbox

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    15

    Resolved [RESOLVED] [02/03] geting the average grade using listbox

    What command should i use for me to compute the grade thaht was listed on the list box..that the user will input..

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

    Re: [02/03] geting the average grade using listbox



    Welcome to the forums man.
    You will have to explain some more for us, what do you mean by grade? And "how to compute the grade" is a very unclear question, by compute you can mean alot of things.
    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

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    15

    Re: [02/03] geting the average grade using listbox

    for example.. the user will input a number in the listbox example {78,90,89,....} the i will click the average button then it will compute the total average of the numbers that was input to the listbox

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

    Re: [02/03] geting the average grade using listbox

    ah ok. Well you know how average values are calculated, correct?
    Add all the values together and divide by the number of values.
    So just do
    VB Code:
    1. dim dblTotal as Double = 0
    2. For each str as string in ListBox1.Items
    3.      dblTotal += Double.Parse(str)
    4. Next
    5. dblTotal = dblTotal / ListBox1.Items.Count
    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)

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    15

    Re: [02/03] geting the average grade using listbox

    i see..thanks..

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

    Re: [02/03] geting the average grade using listbox

    You're welcome. If your problems are solved than resolve your thread using the thread tool menu at the top of the thread. Or do you want more explanation to the code?
    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)

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    15

    Re: [02/03] geting the average grade using listbox

    oh.pls explain how this code works...thanks

  8. #8

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    15

    Re: [02/03] geting the average grade using listbox

    what about for example i will clear the listbox but there is no list at all, when i click the clear button it should show a message box that "no list to be cleared"..

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