commit 7ebcf47d9d757bd704fc461536b245ba19af5c58 Author: Ross Healy Date: Fri Feb 16 10:47:08 2024 +0000 Your initial code you gave me! diff --git a/Nutriants/splits.ps1 b/Nutriants/splits.ps1 new file mode 100644 index 0000000..e88e3a3 --- /dev/null +++ b/Nutriants/splits.ps1 @@ -0,0 +1,33 @@ +#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() + +#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" +} +#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 +} +else { + Exit-PSSession +} +Exit-PSSession \ No newline at end of file