Question: Write a psedocode Validate the input as follows: Make sure the numbers of fat grams and calories aren t less than 0 . Ensure that

Write a psedocode
Validate the input as follows:
Make sure the numbers of fat grams and calories arent less than 0.
Ensure that the number of calories entered isnt greater than fat grams \times 9.
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 \times 9)-: calories
Some nutritionists classify a food as low fat if less than 30 percent of its calories come from fat. If the results of this formula are less than 0.3, the program should display a message indicating the food is low in fat.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!