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: 1oz = 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
(c) Calculate the average %DV 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
(e.g. Figure 1.2)
1. Carbohydrate
2. Protein
3. Fat
Please enter your choice>> 2
1. Low
2. Moderate
3. High
Please enter your choice>> 3
List of cereal (s) with high amount of protein:
1. Cereal B
2. Cereal D
Choose again? Y/N >> N
Figure 1.2: Screen output