How do I stop my e-mail subscription?
Finding Mean, Mode, Meadian and Range
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > Visual Basic Programming > Finding Mean, Mode, Meadian and Range 10 June 2009 04:28:41

  Top users: 
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

Finding Mean, Mode, Meadian and Range

Vbamatuer 11 March 2005 17:43:47
 I need to create a program to find the mean, mode, meadian, and range. I
have the mean so far. I think I can use the SelectionSort to find the
range but not sure. Can anyone help me with this? I would like to assign
it to my class as a project but wanted to practice it before assigning.
New Teacher new to VB.

Add comment
Guest 11 March 2005 20:36:51 permanent link ]
 
vbamatuer wrote:> I need to create a program to find the mean, mode, meadian, and
range. I> have the mean so far. I think I can use the SelectionSort to find
range but not sure. Can anyone help me with this? I would like to
assign> it to my class as a project but wanted to practice it before
assigning.> New Teacher new to VB.

OK, I am not clear on the definitions so I will make this a general
comment.

Assume you start with an array of values or a listbox .

You know how many elements in the array.

the average (i think this is arithmentic mean) is the addition of all
values divided by the number of values.

the range is lowest to highest value.
read through the array testing each value against a stored high and low
value.
assume array of 100 elements with index 0 to 99

maxval = arr(0) ' set high and low value
minval = arr(0)
for inx = 1 to 99
if arr(inx) > maxval then maxval = arr(inx)
if arr(inx) < minval then minval = arr(inx)
next x

range = maxval - minval

-------------------­
the other value is where there are an equal number of values higher and
lower.
simple way of doing this is to put the values into a listbox with sort
= true.
for 100 elements you would select element 49 or 50 (adjustment for
duplicate values)
-------------------­

I hope this helps

Add comment
Vbamatuer 12 March 2005 03:50:02 permanent link ]
 I will try this. Thanks!

Add comment
Guest 7 February 2007 23:54:55 permanent link ]
 me use com pter and neeeed shome helpy duno what 3 do!>
Add comment
Guest 7 February 2007 23:55:57 permanent link ]
 i think that you should learn how to use the computer first you idiot!
Add comment
Guest 7 February 2007 23:56:24 permanent link ]
 no me nowy wans 4 2!
Add comment
Guest 7 February 2007 23:58:35 permanent link ]
 hello any body
i need help on doing my homework i dont know the definition of mode and median
Help please
Add comment
Guest 7 February 2007 23:59:26 permanent link ]
 me to i dont understand that ether!
Add comment
Guest 8 February 2007 00:00:56 permanent link ]
 :-|­ (:|­ ]:-)­ ]:-)­ O:-)­ :'(­ X-(­ X-(­ X-(­ :-P­ :-P­ :-P­ :-D­ :-D­ :-O­ :-O­ :-O­ :-*­ ;-)­ O:-)­ :'(­ :'(­ :'(­ :'(­ O:-)­ (:|­ :-*­ :-D­ :-O­ :-P­ X-(­ ]:-)­
Add comment
Guest 4 August 2008 23:26:30 permanent link ]
 I have made such a program.
You will find it here

http://www.donation­coder.com/Forums/bb/­index.php?topic=1399­8.0
Add comment
Guest 4 August 2008 23:41:31 permanent link ]
 From one teacher to another ...

Get my code from

http://www.planet-s­ource-code.com/vb/sc­ripts/ShowCode.asp?l­ngWId=1&txtCodeId=70­874


Finds the mean, mode, median, range IQR, etc.
Add comment
Guest 10 June 2009 04:19:13 permanent link ]
 ur all faggots get a real life
Add comment
Guest 10 June 2009 04:20:53 permanent link ]
 Public Class Form1
Dim NumList() As Integer
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblMean.Click

End Sub

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

End Sub

Private Sub Button1_Click(ByVal­ sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
RandomArray()
DisplayArray()
DisplayCount()
Sum()
Min()
Max()
Mean()
Range()
Median()
Mode()
End Sub

Private Sub RandomArray()
Dim num, i, length As Integer 'declair num as and integer'

length = CInt(txtCount.Text)­ - 1
For i = 0 To length
ReDim Preserve NumList(i)

num = (100 * Rnd())
NumList(i) = num

Next

End Sub
Private Sub DisplayArray()
txtDisplay.Text = ""
For i = 0 To (NumList.Length - 1)
txtDisplay.Text = txtDisplay.Text & NumList(i).ToString­ & ","

Next

End Sub
Private Sub DisplayCount()

txtCount.Text = NumList.Length

End Sub
Private Sub Sum()
Dim Total = 0

For i = 0 To (NumList.Length - 1)
Total = Total + NumList(i)

Next
txtSum.Text = Total.ToString

End Sub
Private Sub Min() 'minimum number in the list'
Dim min As Integer

min = NumList(0)
For i = 0 To (NumList.Length - 1)
If NumList(i) < min Then
min = NumList(i)

End If
Next
txtMin.Text = min.ToString

End Sub
Private Sub Max() 'maxium nuber in the list'
Dim max As Integer

max = NumList(0)
For i = 0 To (NumList.Length - 1)
If NumList(i) > max Then
max = NumList(i)

End If
Next
txtMax.Text = max.ToString

End Sub
Private Sub Mean() ' sum divided by the count'
Dim Total As Integer

Total = txtSum.Text
txtMean.Text = txtSum.Text / txtCount.Text

End Sub
Private Sub Range() ' max - min'
Dim Range As Integer

Range = txtMax.Text - txtMin.Text
txtRange.Text = Range.ToString

End Sub
Private Sub Median()
Dim temp1, temp2, changed, middle As Integer

changed = 1

Do While changed <> 0
changed = 0
For i = 0 To (NumList.Length - 2)
temp1 = NumList(i)
temp2 = NumList(i + 1)
If temp1 > temp2 Then
NumList(i) = temp2
NumList(i + 1) = temp1
changed = 1
End If
Next
Loop
middle = NumList.Length \ 2
If (NumList.Length Mod 2) = 0 Then
temp1 = NumList(middle)
temp2 = NumList(middle - 1)
txtMedian.Text = (temp1 + temp2) / 2

Else
txtMedian.Text = (NumList(middle)).T­oString
End If
End Sub
Add comment
Guest 10 June 2009 04:23:38 permanent link ]
 whoeva wrote that ^ is a beast ;-)­

ur mum looks like a baboon as well :-D­
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > Visual Basic Programming > Finding Mean, Mode, Meadian and Range 10 June 2009 04:28:41

see also:
Cast boolean to text
Bookmark on another page.
Vote for your favorite database
pass tests:
†...Avatars from Moka...†
see also:

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .