wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes cant get odds to correctly caclulate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cant get odds to correctly caclulate" Watch "cant get odds to correctly caclulate" New topic
Author

cant get odds to correctly caclulate

nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120


what i am trying to do is calculate the odds by oddsOfWinning = 100 * (counterMatches / counterTimes); does anyone know why this isnt working?
nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
i always get 100% no matter what.
nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
i got it working. thanks you guys.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37951
    
  22
nathan gibson wrote:i got it working. thanks you guys.
Well done

How did you correct it?
nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
i just avoided the problem, instead of using a variable in the print i just printed like + counterMatch + "/" counterTimes.
 
jQuery in Action, 2nd edition
 
subject: cant get odds to correctly caclulate
 
Similar Threads
program to calculate male to female ratio of a given number
flipping coin program
cant get counters to work correctly
operator cannot be applied to ints.
Need help with doing a calculation in Java