Home

A Simple Calorie Calculator using Php (menghitung kalori php)




Ini kalkulator kalori sederhana menggunakan php, program ini menghitung berapa banyak kalori yang Anda butuhkan setiap hari untuk menjaga berat badan Anda! Program ini menggunakan metode kasus swith.
  1. <?php
  2. $age=$_POST['age'];
  3. $weight=$_POST['weight'];
  4. $height = $_POST['height'];
  5. $calories="0.0215183";
  6. $gender=$_POST['gender'];
  7. switch ($gender){
  8. case 'Female':
  9. $gender= 655 + (9.6 * $weight ) + (1.8 * $height) - (4.7 * $age);
  10. echo "<p>Your estimated daily metabolic rate is $gender </p>";
  11. echo "<p>This means that you need rouhgly $gender calories a day to maintain your current weight.</p>";
  12. break;
  13. case 'Male':
  14. $gender=66 + (13.7 *$weight) + (5 * $height) - (6.8 * $age);
  15. echo "<p>Your estimated daily metabolic rate is $gender </p>";
  16. echo "<p>This means that you need rouhgly $gender calories a day to maintain your current weight.</p>";
  17. }
  18. ?>

Download Code

Sumber: sourcecodester.com

Unknown

Tempat Tutorial coding dan contoh-contoh aplikasi baik itu php,mysql,android,java, dan html.

Tidak ada komentar:

Posting Komentar