Write a program that asks the user to enter the number of calories and fat grams in
Question:
Write a program that asks the user to enter the number of calories and fat grams in a food item. The program should display the percentage of the calories that come from fat. One gram of fat has 9 calories; therefore:
Calories from fat = Fat grams * 9
The percentage of calories from fat can be calculated as follows:
Calories from fat ÷ Total calories
If the calories from fat are less than 30 percent of the total calories of the food, it should also display a message indicating the food is low in fat.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Question Posted: