TDEE Calculator /* Add your CSS styles here */ h1 { color: #333; font-size: 2em; text-align: center; } form { width: 400px; margin: 0 auto; text-align: left; } #result { margin: 20px 0; font-size: 1.2em; font-weight: bold; } body { font-family: Arial, sans-serif; color: #555; } label { display: block; margin: 10px 0; font-weight: bold; } input[type="number"] { width: 100px; height: 25px; padding: 5px; border: 1px solid #ccc; border-radius: 3px; } select { width: 200px; height: 30px; padding: 5px; border: 1px solid #ccc; border-radius: 3px; background-color: #fff; } button[type="button"] { width: 150px; height: 35px; background-color: #28a745; color: #fff; border: none; border-radius: 3px; cursor: pointer; font-weight: bold; } button[type="button"]:hover { background-color: #218838; } Total Daily Energy Expenditure Calculator Weight (kg): Height (cm): Age: Sex: Male Female Activity Level: Sedentary (little or no exercise) Lightly Active (light exercise/sports 1-3 days/week) Moderately Active (moderate exercise/sports 3-5 days/week) Very Active (hard exercise/sports 6-7 days a week) Extra Active (very hard exercise/sports & physical job or 2x training) Calculate TDEE function calculateTDEE() { // Get form values var weight = document.getElementById("weight").value; var height = document.getElementById("height").value; var age = document.getElementById("age").value; var sex = document.getElementById("sex").value; var activityLevel = document.getElementById("activity-level").value; // Calculate TDEE var tdee; if (sex === "male") { tdee = 66 + (13.7 * weight) + (5 * height) - (6.8 * age); } else { tdee = 655 + (9.6 * weight) + (1.8 * height) - (4.7 * age); } tdee *= activityLevel; // Display result document.getElementById("result").innerHTML = "Your TDEE is: " + tdee.toFixed(2) + " calories/day"; }