Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Write a program in C++ that asks for the number of calories and fat grams in a food. The program should display the percentage of calories that come...

Write a program in C++ that asks for the number of calories and fat grams in a food. The program should display the percentage of calories that come from the fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating the food is low in fat.One gram of fat has 9 calories, so... Calories from fat = fat grams * 9The percentage of calories from fat can be calculated as... Calories from fat / total caloriesInput validation: Make sure the # of calories is greater than 0 and the number of fat grams is 0 or more. Also, the number of calories from fat cannot be greater than the total number of calories. If that happens, display an error message indicating that either the calories or fat grams were incorrectly entered.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question