Jumat, 26 Agustus 2022

MENERAPKAN ARITMATIKA DENGAN HTML, CSS DAN PHP

 Penerapan Aritmatika pada HTML, CSS dan PHP



Berikut merupakan contoh inputnya :

<html>
<head>
    <tittle>PROMO HEMAT!</tittle>
    <body>
    <table border=1 witdh=100%>
            <tr>
                <td align="center"><font size=5> Jenis Barang </font></td>
                <td align="center"><font size=5> Harga Satuan </font></td>
            </tr>
            <tr>
            <td rowspan="6" align="center"><img src="ultraa.jpg" width="250px" height="250px"></td>
            </tr>
            <td>Full Cream : Rp 5500</td>
            </tr>
            <tr>
               <td>Cokelat : Rp 5500</td>
            </tr>
            <tr>
               <td>Stroberi : Rp 5500</td>
            </tr>
            <tr>
               <td>Cokelat (putih) : Rp 6500</td>
            </tr>
            <tr>
               <td>Full Cream (putih) : Rp 6500</td>
            </tr>

    </table>
    <?php
    $nama = "Susu Ultra Full Cream";
    $harga = 5500;
    $jumlah = 4;

    {
        echo "</br>";
        echo "Nama Barang : $nama<br>";
        echo "Harga Barang : $harga<br>";
        echo "Jumlah Barang : $jumlah<br>";
    }
       $total = $harga*$jumlah;{
        echo"Total Barang : Rp $total";
        echo "</br>";
        $discount=(($total*10)/100);
        $total_bayar=($total-$discount);
        echo "</br>";
        echo "Mendapat diskon 10%";
        echo "</br>";
        echo "Total Bayar : Rp. $total_bayar";
        echo "</br>";
    }
   
    ?>
    </body>
</head>
</html>

Outputnya :





Tidak ada komentar:

Posting Komentar

Menambahkan Edit dan Delete pada PHP

 PRAKTIK 1 source code file "koneksi1.php" <?php  $host = mysqli_connect("localhost","root","",...