Question: Fat Gram Calculator Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows:
Fat Gram Calculator
Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows:
Make sure the number of fat grams and calories is not less than
According to nutritional formulas, the number of calories cannot exceed fat grams Make sure that the number of calories entered is not greater than fat grams
Once correct data has been entered, the program should calculate and display the percentage of calories that come from fat. Use the following formula:
Percentage of calories from fat Fat grams Calories
Some nutritionists classify a food as "low fat" if less than percent of its calories come from fat. If the results of this formula are less than the program should display a message indicating the food is low in fat.
In this problem you will get amounts from the user number of fat grams number of calories then calculate the percentage of fats in the calories.You need to validatethe amounts entered by the user before processing them.
Write the pseudocode using the function with loops to validate the imput. write in c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
