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 06:30
What result from the passage of this amendment
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most? a)give the file a unique name b)name the file in yymmdd format c)use descriptive name while naming the files d)use capital letters while naming the file
Answers: 3
question
Computers and Technology, 23.06.2019 12:30
Animations and transitions are added from the
Answers: 1
question
Computers and Technology, 24.06.2019 06:00
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
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
Computers and Technology, 29.06.2019 18:40
Questions on the website: 13722363