Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribedimage text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions