Question: Write a JAVA program to calculate the percentage of calories that comes from fat for a serving of a food. Your program should ask the

Write a JAVA program to calculate the percentage of calories that comes from fat for a serving of a food.

Your program should ask the user to input the food name, grams of fat per serving, and the total calories per serving.

Each input should be provided by the user one at a time through different dialog boxes. Assuming one gram of fat provides 9 calories, calculate the calories from fat and the percentage of total calories that come from fat for this food.

Your program should then output the name of the food, the calories from fat and the percentage of total calories that come from 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 Databases Questions!