Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use C programming and send the answers (a) (b) as soon as possible The % Daily Value (or %DV) shows how much of a

image text in transcribed

Please use C programming and send the answers (a) (b) as soon as possible

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 Cereal B Cereal C Cereal D 2.64 0.34 2.58 1.95 0.26 0.53 0.28 0.44 Figure 1.1: Input File 0.36 0.07 0.63 0.15 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

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

In which of the following environments can sound travel fastest?

Answered: 1 week ago

Question

Which type of energy does an object have when it is in motion?

Answered: 1 week ago

Question

The working principle of a washing machine is?

Answered: 1 week ago

Question

Nuclear sizes are expressed in a unit named?

Answered: 1 week ago

Question

Which mid-week day (non-weekend day) has the best sales?

Answered: 1 week ago

Question

What is the general trend across weekdays (Sunday to Saturday)?

Answered: 1 week ago