Kamis, 09 Oktober 2014

php_rumus tabung

this is script php to determine tabung
the input is heigh and diameter of tabung, then
result is volume, selimut alas, luas tutup,luas tabung, luas alas.
click more to see the script.
thaks for visiting



<?php
@$t= $_POST['tinggi'];
@$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 tabung, selimut tabung, luas alas tabung, luas tutup tabung, luas sisi tabung</h4>
                <tr>
                    <td>Jari-jari</td>
                    <td>:</td>
                    <td><input type="text" name="diameter" value="<?php echo $d; ?>"/>cm</td>
                </tr>
                <tr>
                    <td>Massa beban</td>
                    <td>:</td>
                    <td><input type="text" name="tinggi" value="<?php echo $t; ?>"/>gr</td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td><input type="submit" name="proses" value="Kirim"/></td>
                </tr>
            </table>
        </form>
    </body>
</html>
<?php
$v=3.14;
$r=$d/2;
$volume=$v*$r*$r*$t;
$selimut=2*$v*$r*$t;
$luas= $v*($r*$r);
$luassisi=$volume+$selimut+$luas;
echo" volume tabung adalah <b>$volume </b><br>";
echo" selimut tabung adalah <b>$selimut</b><br>";
echo" luas alas tabung tabung adalah <b>$luas</b><br>";
echo" luas tutup tabung  sama dengan luas alasn tabung adalah <b>$luas</b><br>";
echo" luas sisi tabung adalah  <b>$luassisi</b><br>";

?>

Tidak ada komentar:

Posting Komentar