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

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.

Step by Step Solution

3.38 Rating (167 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To find the percentage of calories from fat we need to ... View full answer

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 Starting Out With Java From Control Structures Questions!