Results 1 to 6 of 6

Thread: Math Probelm

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2001
    Location
    Delaware
    Posts
    50

    Math Probelm

    Im trying to figure out a matmatical equation.

    If i sent out a questionier to 50 people
    and asked how they rated apples on a scale of 1 to 5
    and the results came back like this

    1 ---- 9
    2 ---- 15
    3 ---- 18
    4 ---- 5
    5 ---- 3


    How do you determine what the average is?
    ie, on average people rated apples 2.5
    or whatever the number would be?
    OddPrime
    MCP

    The wild world of geeks
    coming soon at:

    www.renegadegeeks.com

  2. #2
    Fanatic Member steve65's Avatar
    Join Date
    Jun 2000
    Posts
    610
    (1 * 9 + 2 * 15 + 3 * 18 + 4 * 5 + 5 * 3)/50
    This space for rent...

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2001
    Location
    Delaware
    Posts
    50
    Excelent!

    where in Wilmington are you?

    Im in Newcastle? off of 141
    OddPrime
    MCP

    The wild world of geeks
    coming soon at:

    www.renegadegeeks.com

  4. #4
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    shouldn't this be in the maths forum?

  5. #5
    Fanatic Member steve65's Avatar
    Join Date
    Jun 2000
    Posts
    610
    Originally posted by axion_sa
    shouldn't this be in the maths forum?
    Probably...

    I work in downtown Wilmington, Live outside of Philly.
    Last edited by steve65; Jan 23rd, 2002 at 08:42 AM.
    This space for rent...

  6. #6

    Thread Starter
    Member
    Join Date
    Mar 2001
    Location
    Delaware
    Posts
    50
    Its VB Related.


    Code:
    Public Function AvgRating() as long
    
    Dim rst as adodb.recordset
    Dim lngSum as long
    
    
    set rst = conn.open("Select Rate, CountOfRate From tblZ1")
    
    While not rst.Eof = True
         lngSum = lngSum + (Val(rst.Rate) * Val(rst.CountOfRate))
         rst.movenext
    Wend
    
    lngSum = lngSum / 50
    
    AvgRating = lngSum
    
    rst.close
    set rst = nothing
    
    End Function
    OddPrime
    MCP

    The wild world of geeks
    coming soon at:

    www.renegadegeeks.com

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