subject

G Write a complete C++ program that has the user enter the number of calories and the fat grams in a food. The program should calculate and display the percentage of calories that come from fat: One gram of fat has 9 calories Calories from fat = fat grams * 9 Percentage of calories from fat = calories from fat / total calories 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. Input validation—Number of calories and fat grams cannot be less than zero. Also, the number of calories from fat cannot be greater than the total number of calories. Display appropriate error messages. You do not need to check for cin failure. Sample test data: Calories Fat Output 100 3 grams 27 % fat, low in fat 200 12 grams 54% fat 50 0 0 % fat 90 -5 Error in input 45 8 Error in input

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
Which option marks all modification made within a document? review comment track changes balloons
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
Why were most movies from the late 1890s until the early 1930s only filmed in black and white? there were only a few people who could afford the technology to produce color motion pictures back then. audiences did not want color motion pictures until later. the film used to make color motion pictures often overheated, which was a safety hazard, so it was generally not allowed. color films had to be hand-colored, frame by frame.
Answers: 3
question
Computers and Technology, 24.06.2019 07:30
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
question
Computers and Technology, 24.06.2019 23:00
The valves of the heart and veins are similar in that they both
Answers: 1
You know the right answer?
G Write a complete C++ program that has the user enter the number of calories and the fat grams in a...
Questions
question
Mathematics, 01.09.2019 07:30
question
Mathematics, 01.09.2019 07:30
Questions on the website: 13722361