Advertisement
ini_PlayeR

Tugas 2 BAB 9 Statement FOR

Mar 24th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>Statement FOR</title>
  4. </head>
  5.  
  6. <body>
  7. <center><h1>Tugas 2</h1></center>
  8.  
  9. <form method="POST" action="">
  10.     Masukkan saldo anda
  11.     <input type="text" name="saldo"><br>
  12.     Masukkan jumlah bulan
  13.     <input type="text" name="bulan"><br>
  14.     <input type="submit" value="Submit">
  15.     <input type="reset" value="Reset">
  16. </form>
  17.  
  18. <?php
  19.     $saldo = $_POST[saldo];
  20.     $bulan = $_POST[bulan];
  21. if ($saldo<1100000)
  22. {
  23.     for($i=1;$i<=$bulan;$i++)
  24.     {
  25.         $saldo = $saldo-9000+($saldo*0.03);
  26.     }
  27.     echo $saldo;
  28. }
  29. else
  30. {
  31.     for($i=1;$i<=$bulan;$i++)
  32.     {
  33.         $saldo = $saldo-9000+($saldo*0.04);
  34.     }
  35.     echo $saldo;
  36. }
  37. ?>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement