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...


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 0.

  •  According to nutritional formulas, the number of calories cannot exceed fat grams x 9. Make sure that the number of calories entered is not greater than fat grams x 9.


Once corrected 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 x 9) / calories


ANSWER IN PSEUDOCODE


USE ONLY WHILE LOOPS


DO NOT USE MODULES/FUNCTIONS



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here