QUESTION 1 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 4 years of age and older. To calculate the % DV of a packaged food, you have to divide the nutrient amount per serving by the daily recommended value and multiply by 100. To know whether you are getting enough amount of a certain nutrient from a packaged food, the following level of categorization applies:

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 8RA
icon
Related questions
Question
QUESTION 1
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 4 years of age and older. To
calculate the %DV of a packaged food, you have to divide the nutrient amount per serving
by the daily recommended value and multiply by 100. To know whether you are getting
enough amount of a certain nutrient from a packaged food, the following level of
categorization applies:
• 5% or less of a nutrient per serving is low
• More than 5% but less than 20% of a nutrient per serving is moderate
20% or more of a nutrient per serving is high
Write a complete C 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 1.1
with data for 10 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.
Cereal A
2.64
0.26
0.36
Cereal B
0.34
0.53
0.07
Cereal C
2.58
0.28
0.63
Cereal D
1.95
0.44
0.15
Figure 1.1: 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: loz = 28.35g
(b) Calculate the %DV of each nutrient (g) for each cereal. Note: The daily recommended
value for all three nutrients are as follows:
Carbohydrate – 300g
Protein – 50g
Fat - 65g
Transcribed Image Text:QUESTION 1 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 4 years of age and older. To calculate the %DV of a packaged food, you have to divide the nutrient amount per serving by the daily recommended value and multiply by 100. To know whether you are getting enough amount of a certain nutrient from a packaged food, the following level of categorization applies: • 5% or less of a nutrient per serving is low • More than 5% but less than 20% of a nutrient per serving is moderate 20% or more of a nutrient per serving is high Write a complete C 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 1.1 with data for 10 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. Cereal A 2.64 0.26 0.36 Cereal B 0.34 0.53 0.07 Cereal C 2.58 0.28 0.63 Cereal D 1.95 0.44 0.15 Figure 1.1: 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: loz = 28.35g (b) Calculate the %DV of each nutrient (g) for each cereal. Note: The daily recommended value for all three nutrients are as follows: Carbohydrate – 300g Protein – 50g Fat - 65g
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Payback period
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr