You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 73 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - I need help with mathmatical issue [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
White_Devil
Nuke Cadet
Nuke Cadet


Joined: Jan 08, 2006
Posts: 5


PostPosted: Fri Mar 03, 2006 6:09 am Reply with quoteBack to top

It not really a coding problem but a mathmatical issue.

I am writing a hot or not type script for php-nuke. Check out hotornot.com to see what i am going to ask.

When a user clicks a vote number 1-10 .. It will then take it and compare to the total votes and get an advrage. oviously 1-10.

My questions are...
How do i get the advarage?
Do i need to record all votes to make it work?
Find all posts by White_DevilView user's profileSend private messageSend e-mail
jakec06
Sergeant
Sergeant


Joined: Jan 30, 2006
Posts: 75

Location: Surrey, UK

PostPosted: Fri Mar 03, 2006 10:53 am Reply with quoteBack to top

To get the average all you need to do is add the votes together and divide by the number of votes.

For example:

Person 1 votes = 7
Person 2 votes = 5
Person 3 votes = 6

Add them together: 7+5+6 = 18

Divide that by the total number of votes: 18/3=6 (average)

You wouldn't need to record all the votes just keep adding the new vote to the sum of the previous votes and divide by the total number of votes.


Jakec
Find all posts by jakec06View user's profileSend private message
White_Devil
Nuke Cadet
Nuke Cadet


Joined: Jan 08, 2006
Posts: 5


PostPosted: Fri Mar 03, 2006 12:51 pm Reply with quoteBack to top

Thank you that helped out alot. Made me think of how I should do it exactly. Your help was much appreciated. Thanks again.
Find all posts by White_DevilView user's profileSend private messageSend e-mail
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.341 Seconds - 276 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::