₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,089 members, 8,420,262 topics. Date: Thursday, 04 June 2026 at 03:02 PM

Toggle theme

Please Help Me Write This Simple Php Switch Statement - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingPlease Help Me Write This Simple Php Switch Statement (944 Views)

1 Reply (Go Down)

Please Help Me Write This Simple Php Switch Statement by Nobody: 12:45am On Jul 27, 2015
Nor laugh me oo grin

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:
Nor laugh me oo grin

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
You've got to be kidding me undecided
Re: Please Help Me Write This Simple Php Switch Statement by DonSegmond(m): 5:12am On Jul 27, 2015
Yungwizzzy:
Nor laugh me oo grin

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
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;

?>
1 Reply

Magento Theme Tutorial: Find Out How To Switch To Different ThemeFizzbuzz Problem Using "Switch" Statement ConstructHelp A Java Newbie With This Simple Java Program234

STATA TutorHow To Repair OST 2010 Data?Security Guide For Developers