Please Help Me Write This Simple Php Switch Statement - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Please Help Me Write This Simple Php Switch Statement (944 Views)
| Please Help Me Write This Simple Php Switch Statement by Nobody: 12:45am On Jul 27, 2015 |
Nor laugh me oo Question: 4 green balls 5 yellow balls 6 blue balls 7 white balls 9 black balls if i pick 9 balls What is the the probability of picking black and white The solution should be in a script .Thanks |
| Re: Please Help Me Write This Simple Php Switch Statement by Abduletudaye(m): 5:10am On Jul 27, 2015 |
Yungwizzzy:You've got to be kidding me ![]() |
| Re: Please Help Me Write This Simple Php Switch Statement by DonSegmond(m): 5:12am On Jul 27, 2015 |
Yungwizzzy:If you can't solve this, then perhaps your problem is not a programming problem, but a probability problem. You must be able to solve the problem on a piece of a paper before a computer. The computer is no substitute for thinking. With that said, if you want to know how to use a switch statement with php. http://php.net/manual/en/control-structures.switch.php For probability, this should help, http://mathforum.org/dr.math/faq/faq.prob.intro.html |
| Re: Please Help Me Write This Simple Php Switch Statement by veltany: 8:11am On Jul 27, 2015 |
<?php /* probability(p) is calculated as posible outcomes(x)/required outcomes(t). P=x/t func probability($arg1,$arg2) return: int $result */ function probability($x,$t) { return $x/$t; } //example $p=probability(9,25); echo $p; ?> |
Magento Theme Tutorial: Find Out How To Switch To Different Theme • Fizzbuzz Problem Using "Switch" Statement Construct • Help A Java Newbie With This Simple Java Program • 2 • 3 • 4
STATA Tutor • How To Repair OST 2010 Data? • Security Guide For Developers
