Skip to content

Benfit2026/Benfit.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Benfit.github.io

Calorie calculator

<title>Calorie Calculator</title> <style> body { font-family: Arial; max-width: 400px; margin: auto; } input, select, button { width: 100%; margin: 5px 0; padding: 8px; } .brand { font-size: 12px; color: gray; margin-top: 10px; } </style>

Calorie Calculator

Male Female Sedentary Light Moderate Active Very Active

Calculate

Built with AI assistance (ChatGPT)
<script> function calculate() { let age = document.getElementById("age").value; let weight = document.getElementById("weight").value; let height = document.getElementById("height").value; let gender = document.getElementById("gender").value; let activity = document.getElementById("activity").value; let bmr; if (gender === "male") { bmr = 10 * weight + 6.25 * height - 5 * age + 5; } else { bmr = 10 * weight + 6.25 * height - 5 * age - 161; } let calories = bmr * activity; document.getElementById("result").innerText = "Daily Calories: " + Math.round(calories); } </script>

About

Calorie calculator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors