Question: Need help writing a program as per the flow chart below: Global Constant Real CALORIES FROM FAT CALORIES_FROM_CARBS main() getFat setFat (Ref inputFat) (gramsFat, caloriesFat),
Need help writing a program as per the flow chart below:


Global Constant Real CALORIES FROM FAT CALORIES_FROM_CARBS main() getFat setFat (Ref inputFat) (gramsFat, caloriesFat), Display "Enter Declare fat grams caloriesFat = gramsFat * CALORIES_FROM_FAT gramsFat, gramsCarbs, consumed caloriesFat, caloriesCarbs Input Return inputFat getFat (gramsFat) Return setCarbs (gramsCarbs, calories Carbs) getCarbs (gramsCarbs) getCarbsl (Ref inputCarbs) caloriesCarbs = gramsCarbs * RIES_FROM_CARBS setFat Display "Enter (gramsFat, caloriesFat) carbohydrate grams consumed" Return Input setCarbs inputCarbs (gramsCarbs, caloriesCarbs) showCarbs I(gramsFat, gramsCarbs, caloriesFat, caloriesCarbs) Return showCarbs (gramsFat, gramsCarbs, Display caloriesFat, "Grams of Fat: ", gramsFat caloriesCarbs) "Result calories: ", caloriesFat "Grams of Carbs: ", gramsCarbs "Result calories: ", caloriesCarbs End ReturnSample test case Enter the fat grams consumed: 180 Enter the carbohydrate grams consumed: 26 Grams of fat: 100.00 Fat calories: 998.80 Grams of carbs: 20.08 Carb calories: 88.80 >>>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
