Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Diet Question: Tables, Inputs, and Excel

1 Ansicht (letzte 30 Tage)
CW
CW am 15 Feb. 2016
Geschlossen: Walter Roberson am 17 Feb. 2016
The following table lists the protein, fat, carbohydrate, and energy content of a number of common foods. Write a MATLAB program that computes the total grams of protein, fat and carbohydrates consumed daily based on the amount of each food type consumed during the day. The program should query the user to input the number of food items eaten during the day, the specific foods that were eaten, and the amount of each specific food eaten. Based on this information, the program should perform the following tasks:
a. Compute the total solids and water intake for the day (assume that the solids content is 30% and the water content is 70%).
b. Compute the total grams of protein, fat, and carbohydrates derived from each food
c. Compute the available energy from protein, fat and carbohydrates eaten during the day (assume the available energy in food is as follows: carbohydrates – 4 calories/gram, fat – 9 calories/gram, and protein – 4 calories/gram).
d. Compare the available energy from protein, fat and carbohydrates obtained in c above to the average for Americans of 15% from protein, 40% from fat, and 45% from carbohydrates.
The MATLAB program should output the following:
a. Total solids and water intake for the day
b. A labeled table listing the total grams of protein, fat, and carbohydrates derived from each food and the total grams of protein, fat, and carbohydrates consumed for the day.
c. A pie graph comparing the percentage fat, protein and carbohydrates in the daily diet.
d. A bar graph comparing the energy derived from protein, fat, and carbohydrates for the day to that for the average American diet.
Protein, Fat, Carbohydrate, and Energy Content of Food
Food %Protein %Fat %Carbohydrate Fuel value/100 g (kcal)
Apples 0.3 0.4 14.9 64
Asparagus 2.2 0.2 3.9 26
Bacon, broiled 25.0 55.0 1.0 599
Bread, white 9.0 3.6 49.8 268
Cheese 23.9 32.3 1.7 393
Milk, whole 3.5 3.9 4.9 69
Oatmeal 14.2 7.4 68.2 396
Orange 0.9 0.2 11.2 50
Pork, ham 15.2 31.0 1.0 340
Potatoes 2.0 0.1 19.1 85
Provide a flow chart that describes the Program and output for the following test data:
Breakfast: 200 g Oatmeal, 75 g milk, 1 orange (225 g)
Lunch: 1 apple (100 g), 4 slices bread (100 g), 90 g bacon, 40 g cheese
Dinner: 350 g pork, 150 g asparagus, 150 g potatoes, 2 slices bread (50 g)

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by