1 Replies - 1117 Views - Last Post: 18 December 2010 - 04:01 AM

#1 atik97  Icon User is offline

  • ???
  • member icon

Reputation: 144
  • View blog
  • Posts: 715
  • Joined: 16-September 08

Arithmetic Mean

Posted 20 April 2009 - 07:58 AM

Description: This will find arithmetic mean of grouped data items.
function mean()
    print ("Enter number of class:")
	n=io.read()
    print ("Enter class interval:")
	h=io.read()
    sum_f=0
    sum_fx=0
    for i=1,n do
        print ("For class",i)
        print ("Enter lower limit:")
		l=io.read()
        --upper limit
        u=l+h
        print ("Enter frequency:")
		f=io.read()
        x=(l+u)/2
        fx=f*x
        sum_fx=sum_fx+fx
        sum_f=sum_f+f
	end

    --mean of the data
    mean=sum_fx/sum_f
    print("The mean of the given data is",mean)
end


Is This A Good Question/Topic? 0
  • +

Replies To: Arithmetic Mean

#2 deeawe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 18-December 10

Re: Arithmetic Mean

Posted 18 December 2010 - 04:01 AM

i don't grab at all. why do expert in programming make it so difficult for beginners like me....i have been to so many websites just to find a program for the simple arithmetic mean with so easy solution
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1