# Prompt for user inputs $Weight = Read-Host "Please input weight in kg" $Height = Read-Host "Please input height in cm" $Age = Read-Host "Please input age in years" $Gender = Read-Host "Are you Male (M) or Female (F)? (M/F)" # Convert height to meters for calculation (assuming input is in cm) $HeightMeters = [decimal]$Height / 100 # Determine BMR and macronutrient splits based on gender if ($Gender -eq "F" -or $Gender -eq "f") { $Calories = 655.1 + (9.563 * [decimal]$Weight) + (1.850 * [decimal]$Height) - (4.676 * [decimal]$Age) } elseif ($Gender -eq "M" -or $Gender -eq "m") { $Calories = 66.47 + (13.75 * [decimal]$Weight) + (5.003 * [decimal]$Height) - (6.755 * [decimal]$Age) } else { Write-Host "Invalid input for gender. Exiting." Exit } # Calculate macronutrient calories $Protein_Cals = ($Calories / 10) * 2 $Carbs_Cals = ($Calories / 10) * 6 $Fat_Cals = ($Calories / 10) * 2 # Display results Write-Host "Your BMR is:" ([math]::Round($Calories, 0)) "kcals" Write-Host "Your recommended protein intake is:" ([math]::Round($Protein_Cals, 0)) "kcals" Write-Host "Your recommended carbohydrate intake is:" ([math]::Round($Carbs_Cals, 0)) "kcals" Write-Host "Your recommended fat intake is:" ([Math]::Round($Fat_Cals, 0)) "kcals"