Rabu, 08 Oktober 2014

PHP kerucut

i take this opportunity to share to calculate kubus using formula
below are the scriptnya please click to view



<?php
@$d=$_POST['diameter'];
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <form action="#" method="POST">
            <table>
                <h4>Menentukan volume dan luas sisi bola basket</h4>
                <tr>
                    <td>Diameter</td>
                    <td>:</td>
                    <td><input type="text" name="diameter" value="<?php echo $d; ?>"/></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td><input type="submit" name="proses" value="Kirim"/></td>
                </tr>
            </table>
        </form>
    </body>
</html>
<?php
$r=$d/2;
$hasil=(4*($r*$r*$r))/3*(3.14);
$luas=(4*($r*$r*$r))*3.14;
echo "hasil volume sebuah basket adalah <b>$hasil </b> <br>";
echo "hasil luas sisi sebuah bola basket <b>$luas</b>";
?>

Tidak ada komentar:

Posting Komentar