Hi experts,
I am doing an exercise which has the following requirements.
Charlie will bite your finger exactly 50% of the time. First, write a function isBitten() that returns TRUE with 50% probability, and FALSE otherwise
To generate a webpage that displays "Charlie bit your finger!" or "Charlie did not bite your finger!" using the isBitten() function.
I have written the below and geeting error in line 11 of the below code.
<!DOCTYPE html>
<html>
<body>
<?php
function isbitten ()
{
$list{10}=rand(0,0.5);
for ( $i=0; $i<100; $i )
if ( $list[$i] == o.5 )
return True ;
else
return False ;
}
$r= function isbitten();
if( $r == "True")
{
Print "Charlie bit your finger!";
else
Print "Charlie did not bit your finger!"
}
?>
</body>
</html>
Request your expert opinion to help figure out the solution.
Best Regards,
ND