Compare commits
2 Commits
main
...
feature/rh
| Author | SHA1 | Date | |
|---|---|---|---|
| ac50369914 | |||
| b697ca6b29 |
@@ -1,33 +1,59 @@
|
||||
#VARS
|
||||
[decimal]$Weight = Read-Host "Please input weight in kg"
|
||||
[decimal]$Height = Read-Host "Please input height in cm"
|
||||
[decimal]$Age = Read-Host "Please input age in years"
|
||||
[char]$Gender = Read-Host "Are you Male (M) or Female (F)".ToUpper()
|
||||
# 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)"
|
||||
$ActivityLevel = Read-Host "Please input your activity level (Sedentary, Light, Moderate, Active, Very Active, Extra Active)"
|
||||
|
||||
#determining split (female)
|
||||
if ($Gender = "F") {
|
||||
$Calories = 655.1 + (9.563 * $weight) + (1.850 + $Height) - (4.676 * $Age)
|
||||
|
||||
$Protein_Cals = ($Calories/10)*2
|
||||
$Carbs_Cals = ($Calories/10)*6
|
||||
$Fat_Cals = ($Calories/10)*2
|
||||
Write-Host "Your BMR is:"([math]::Round($Calories,0))
|
||||
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"
|
||||
# Convert height to meters for calculation (assuming input is in cm)
|
||||
$HeightMeters = [decimal]$Height / 100
|
||||
|
||||
# Determine BMR based on gender
|
||||
if ($Gender -eq "F" -or $Gender -eq "f") {
|
||||
$BMR = 655.1 + (9.563 * [decimal]$Weight) + (1.850 * [decimal]$Height) - (4.676 * [decimal]$Age)
|
||||
}
|
||||
#determing split (male)
|
||||
elseif ($Gender = "M") {
|
||||
$Calories = 66.47 + (13.75 * $weight) + (5.003 + $Height) - (6.755 * $Age)
|
||||
$Protein = $Calories/4
|
||||
$Carbs = $Calories/4
|
||||
$Fats = $Calories/9
|
||||
Write-Host "Your BMR is: " $Calories
|
||||
Write-Host "Your recommended protein intake is: " $Protein
|
||||
Write-Host "Your recommended carbohydrate intake is: " $Carbs
|
||||
Write-Host "Your recommended fat intake is: " $Fats
|
||||
elseif ($Gender -eq "M" -or $Gender -eq "m") {
|
||||
$BMR = 66.47 + (13.75 * [decimal]$Weight) + (5.003 * [decimal]$Height) - (6.755 * [decimal]$Age)
|
||||
}
|
||||
else {
|
||||
Exit-PSSession
|
||||
Write-Host "Invalid input for gender. Exiting."
|
||||
Exit
|
||||
}
|
||||
Exit-PSSession
|
||||
|
||||
# Calculate daily calorie needs based on activity level
|
||||
switch ($ActivityLevel) {
|
||||
"Sedentary" {
|
||||
$CalorieNeeds = $BMR * 1.2
|
||||
}
|
||||
"Light" {
|
||||
$CalorieNeeds = $BMR * 1.375
|
||||
}
|
||||
"Moderate" {
|
||||
$CalorieNeeds = $BMR * 1.55
|
||||
}
|
||||
"Active" {
|
||||
$CalorieNeeds = $BMR * 1.725
|
||||
}
|
||||
"Very Active" {
|
||||
$CalorieNeeds = $BMR * 1.9
|
||||
}
|
||||
"Extra Active" {
|
||||
$CalorieNeeds = $BMR * 2.2
|
||||
}
|
||||
default {
|
||||
Write-Host "Invalid input for activity level. Exiting."
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
# Calculate macronutrient calories
|
||||
$Protein_Cals = ($CalorieNeeds / 10) * 2
|
||||
$Carbs_Cals = ($CalorieNeeds / 10) * 6
|
||||
$Fat_Cals = ($CalorieNeeds / 10) * 2
|
||||
|
||||
# Display results
|
||||
Write-Host "Your BMR is:" ([math]::Round($BMR, 0)) "kcals"
|
||||
Write-Host "Your daily calorie needs based on your activity level are:" ([math]::Round($CalorieNeeds, 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"
|
||||
|
||||
Reference in New Issue
Block a user