|
-
Nov 9th, 2006, 07:16 AM
#1
Thread Starter
New Member
-
Nov 9th, 2006, 07:19 AM
#2
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.
-
Nov 9th, 2006, 07:24 AM
#3
Thread Starter
New Member
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
-
Nov 9th, 2006, 07:34 AM
#4
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:
dim dblTotal as Double = 0
For each str as string in ListBox1.Items
dblTotal += Double.Parse(str)
Next
dblTotal = dblTotal / ListBox1.Items.Count
-
Nov 9th, 2006, 08:25 AM
#5
Thread Starter
New Member
Re: [02/03] geting the average grade using listbox
-
Nov 9th, 2006, 09:44 AM
#6
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?
-
Nov 9th, 2006, 06:06 PM
#7
Thread Starter
New Member
Re: [02/03] geting the average grade using listbox
oh.pls explain how this code works...thanks
-
Nov 9th, 2006, 06:12 PM
#8
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|