Question: Courses Chapter 4 You are tasked to provide a Fat Gram Calculator program for a local Weight Loss Center. The program should ask the user

 Courses Chapter 4 You are tasked to provide a Fat Gram

Courses Chapter 4 You are tasked to provide a Fat Gram Calculator program for a local Weight Loss Center. The program should ask the user for the name of a food item, the number of calories and the number of fat grams in the item. The program should display the percentage of calories that come from fat. If the calories from fat are less than 30 percent of the total calories of the food, it should display a message indicating that the food is low in fat. If the percentage is equal to or higher than 30 percent the message should indicate that the food is high in fat. One gram of fat has 9 calories, so calories from fat fat grams 9 The percentage of calories from fat can be calculated as Calories from fat/total calories Input validation: The program should make sure that the number of calories is greater than 0, the number of fat grams is 0 or more, and the number of calories from fat is not greater than the number of calories input

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!