Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Tugas 3 Modul 6</title>
- </head>
- <body>
- <h1>Menghitung Gaji Pegawai Honorer</h1>
- <form method="get"action=" ">
- Jumlah Jam Kerja <input type="text" name="jam" /><br/>
- <input type="submit" name="submit" value="submit" />
- <input type="reset" name="reset" value="reset" /><br/>
- <?php
- $jam = $_GET['jam'];
- $upah1 = 2000;
- $upah2 = 3000;
- $gaji1 = $jam * $upah1;
- $lembur = ($jam - 48) * $upah2;
- $gaji2 = (48 * $upah1) + $lembur;
- echo "Jumlah Jam Kerja ".$_GET['jam']. " jam/minggu <br>";
- switch($jam)
- {
- case $jam <= 48 : echo "Gaji = Rp. ".$gaji1."</br>";
- break;
- case $jam > 48 : echo "Gaji = Rp. ".$gaji2."</br>";
- break;
- default : "Belum Memasukan Jumlah Jam Kerja";
- }
- ?>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement