Senin, 08 Oktober 2012

Program Rumus Volume Bangun Ruang dengan PHP

CONTOH PROGRAM PERHITUNGAN RUMUS VOLUME BANGUN RUANG MENGGUNAKAN PHP

Program ini saya buat untuk menghitung rumus volume bangun ruang. Program ini berisi input dan output dari perhitungan rumus volume bangun ruang.

Gambar dari menu awal :


Berikut contoh programnya :

1. Home.html
    adl halaman pambuka(awal) yang berisi menu pilihan dari rumus" volume bangun ruang.


 <html>
 <head>
  <title>Menu</title>
 </head>
 <body bgcolor="lightblue">
 <table style="-moz-border-radius:20px ; -web-kit-radius:20px ; -o-border-radius:20px; border:5px solid blue"  width="50%" align="center">
  <tr>
   <th style="-moz-border-radius:10px ; -web-kit-radius:10px ; -o-border-radius:10px; color:blue; colspan="3" bgcolor="black" height="50">
    <font face="algerian" size="10">
    ### MENU ###
</font>
   </th>
  </tr>
  <tr>
   <td style="color:blue" bgcolor="black">
    <center>
    RUMUS BANGUN RUANG
<center>
   </td>
  </tr>
  <tr>
  <tr>
   <td style="-moz-border-radius:10px ; -web-kit-radius:10px ; -o-border-radius:10px; color:blue; " bgcolor="black">
   <ul style="color:red">
    <br>
    <li>
<a href="volume1.php" style="color:blue">
      Volume Kubus
     </a><br>
    <li>
<a href="volume2.php" style="color:blue">
      Volume Balok
     </a><br>
    <li>
<a href="volume3.php" style="color:blue">
      Volume Prisma
     </a><br>
    <li>
<a href="volume4.php" style="color:blue">
      Volume Limas
     </a><br>
    <li>
<a href="volume5.php" style="color:blue">
      Volume Tabung
     </a><br>
    <li>
<a href="volume6.php" style="color:blue">
      Volume Kerucut
     </a>
</ul>
     </td>
    </tr>
   </table>
  </body>
 </html>


2. volume1.php
     adl program yang berisi tentang input/masukan perhitungan rumus volume kubus.

 <html>
 <head>
  <title>Hitung Volume KUBUS</title>
 </head>
 <body bgcolor="lightblue">
 <br><br>
  <form action="tampilan_vol1.php" method="get">
   <table border="2" bgcolor="black" style="color:blue">
    <tr>
<th colspan="2">
 Volume Kubus
</th>
</tr>
<tr>
     <td>
      Masukan panjang rusuknya :
</td>
<td>
     <input type="text" name="rusuk" maxlength="6" size="20"><br>
</td>
    </tr>
<tr>
<td>
     <input type="submit" name="hitung" value="Hitung">
</td>
<td>
     <input type="reset" name="reset" value="Hapus">
</td>
</tr>
  </form>
  <form action="Home.html">
    <tr>
<td colspan='2'>
 <center>
 <input type="submit" name="submit" value="Home">
 </center>
</td>
</tr>
</table>
  </form>
  </body>
 </html>

Berikut tampilanya :



3. tampilan_vol1.php
    adl Program yang berisi tentang output/tampilan dari perhitungan volume balok atau dari keluaran dari volume1.php

<html>
 <head>
  <title>Hasil</title>
 </head>
 <body bgcolor="lightblue">
 <?php

 $r = $_GET['rusuk'];

 $V = (6 * $r);
 echo "<table border='2' bgcolor='black' style='color:blue'><tr><th colspan='2'>Jawabanya</th></tr>";
 echo "<tr><td colspan='2'>Diketahui</td><tr><td> >> Panjang rusuknya : </td><td> $r cm</td></tr><br>";
 echo "<tr><td>Jadi volume kubusnya adalah : </td><td><b><u> $V cm3 </u></b></td></tr>";
 ?>
 <form action='volume1.php'>
  <tr>
   <td>
    <input type='submit' name='submit1' value='Back'>
   </td>
 </form>
 <form action='Home.html'>
   <td>
    <input type='submit' name='submit2' value='Home'>
   </td>
  </tr>
 </table>
 </form>
 </body>
</html>

Berikut tapilanya :

4. volume2.php
     adl Program yang berisi tentang input/masukan dari rumus perhitungan volume balok.
<html>
 <head>
  <title>Hitung Volume BALOK</title>
 </head>
 <body bgcolor="lightblue">
  <form action="tampilan_vol2.php" method="get">
  <table border="2" bgcolor="black" style="color:blue">
    <tr>
<th colspan="2">
Volume Balok
</th>
</tr>
<tr>
<td>
      Masukan Panjang :
 </td>
 <td>
       <input type="text" name="panjang" maxlength="6" size="20">
 </td>
</tr>
<tr>
 <td>
       Masukan Lebar :
      </td>
 <td>
       <input type="text" name="lebar" maxlength="6" size="20">
      </td>
</tr>
<tr>
 <td>
       Masukan Tinggi :
      </td>
 <td>
       <input type="text" name="tinggi" maxlength="6" size="20">
      </td>
</tr>
<tr>
 <td>
       <input type="submit" name="hitung" value="Hitung">
      </td>
 <td>
       <input type="reset" name="reset" value="Hapus">
 </td>
</tr>
</form>
     <form action="Home.html">
<tr>
<td colspan='2'>
 <center>
 <input type="submit" name="submit" value="Home">
 </center>
</td>
</tr>
</table>
   </form>
  </body>
 </html>

Berikut tampilanya :



5. tampilan_vol2.php
    adl Program yang berisi tentang output/tampilan dari perhitungan volume balok atau dari keluaran dari volume2.php
<html>
 <head>
  <title>Hasil</title>
 </head>
 <body bgcolor="lightblue">
 <?php
 $p = $_GET['panjang'];
 $l = $_GET['lebar'];
 $t = $_GET['tinggi'];
 $V = ( $p * $l * $t );
 echo "<table border='2' bgcolor='black' style='color:blue'><tr><th colspan='2'>Jawabanya</th></tr>";
 echo "<tr><td>Panjang : </td><td> $p cm </td></tr>";
 echo "<tr><td>Lebar : </td><td> $l cm </td></tr>";
 echo "<tr><td>Tinggi : </td><td> $t cm </td></tr>";
 echo "<tr><td>Jadi... Volume Baloknya adalah :</td><td><b><u> $V cm3 </b></u> </td></tr>";
 ?>
  <form action='volume2.php'>
  <tr>
   <td>
    <input type='submit' name='submit1' value='Back'>
   </td>
 </form>
 <form action='Home.html'>
   <td>
    <input type='submit' name='submit2' value='Home'>
   </td>
  </tr>
 </table>
 </body>
</html>

Berikut tampilanya :





Berikut cuma beberapa program dari yang saya buat, klo mau yang lebih lengkap silahkan download disini...!