EasyCFM.COM ColdFusion Forums / Coding Help! / Math & SQL

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Math & SQL

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

MIGhunter
04-15-2010 @ 11:56 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 568
Joined: Apr 2006

I have a friend that wants me to design them a priority system for a class.  I am struggling with how to do the math and then add it to the sql.  

Here is what she is looking for.
She wants to compare a students GPA and how far they travel in order to prioritize class sign ups.  Here is the issue.  The comparison needs to take into consideration GPA with more weight than distance.  i.e. Someone with a 4.0 GPA that travels 5 miles should get more priority than someone with a 2.0 GPA that travels 200 miles.

Any suggestions on how to set this up?

Webmaster
04-16-2010 @ 3:09 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4533
Joined: Jan 2002

I would say I would need to understand all the points; but based on the simple example I would do this:

GPA*1000 + distance

so

4.0x1000 = 4000 + 5 = 4005
2.0X1000 = 2000 + 200 = 2200

Naturally the one above would be higher and get priority... that would be a simple approach; but again depends on the whole picture... let me know all the cases and I will what I can do to help Smile

~P

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

\m/ (>.<) \m/
--- rock on ---

MIGhunter
04-16-2010 @ 4:34 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 568
Joined: Apr 2006

Basically she is a nursing student.  75% of the students commute to the university from 1-2 hours away.  The schedules are very sporadic and there is no preference for students who commute.  She made a proposal to her professors on this little project so she asked me to write the program.  So, it needs to make sure that people who have the highest GPA get 1st dibs on the "good" schedule but weigh in the distance of the commute.

Make sense?

dlackey
04-16-2010 @ 9:39 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 935
Joined: Jun 2007

check out this thread to see if helps you.  It helped me when I was doing something like this...  My had a random factor but it may be able to be taken out...

http://www.easycfm.com/coldfusion/forums/viewmessages.cfm?Forum=12&Topic=13993&keywords=weight

Cheers,
Chip

Sponsored By...
iOpenSoft, LLC is a Houston, Texas Advanced Technology Studio Specializing in Web Design, Web Development, iPhone App Development and Android App Development.