Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CASE STUDY 1 The % Daily Value ( or % DV ) shows how much of a nutrient is in one serving of a packaged
CASE STUDY
The Daily Value or DV shows how much of a nutrient is in one serving of a packaged food. The DVs are based on the values for key nutrients, which are the amounts in grams of nutrients recommended per day for individuals years of age and older. To calculate the of a packaged food, you have to divide the nutrient amount per serving by the daily recommended value and multiply by To know whether you are getting enough amount of a certain nutrient from a packaged food, the following level of categorization applies:
or less of a nutrient per serving is low
More than but less than of a nutrient per serving is moderate
or more of a nutrient per serving is high
Write a complete program that reads a list of data cereal type, carbohydrate in ounce, protein in ounce, fat in ounce from an input file. Prepare the input file as shown in Figure with data for types of cereal. For the first four types of cereal Cereal A B C D use the values as shown in the figure below. Complete the file for the remaining six types of cereal with your own values.
tableCerealACerealBCerealCCerealD
Figure : Input File
By reading the input file that you have prepared, your program should be able to:
a Calculate the conversion of the nutrient values in ounce oz into gram g with two decimal places. Note:
b Calculate the DV of each nutrient g for each cereal. Note: The daily recommended value for all three nutrients are as follows:
Carbohydrate Protein Fat
c Calculate the average of Carbohydrate, Protein and Fat for all cereals.
d Determine and display the category of each nutrient, either low, moderate or high.
e Output on screen: Ask the user to enter choice of nutrient carbohydrate protein, fat and level low moderate, high and display the food listed under that category eg Figure
Carbohydrate
Protein
Fat
Please enter your choice
Low
Moderate
High
Please enter your choice
List of cereals with high amount of protein:
Cereal B
Cereal D
Choose again?
Figure : Screen output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started