Fat Percentage Calculator Create an application that allows the user to enter the number of calories and fat grams in a food. The application should display percentage of the calories that come from 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. (Display the message in a label or a message box.) The application's form should appear similar to the one shown in Figure 4-35. One gram of fat has 9 calories, so: Calories from fat = fat grams 9 The percentage of calories from fat can be calculated as: Percentage of calories from fat = Calories from fat / total calories Fat Percentage Calculater Entor the number of colonos in the food 200 Enter the number of lat grams in the food Parcentage of cainnes that come from tar 300 % Calculate Input validation: Make sure the number of calories and fat grams are numeric, and are not less than 0. 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. Use the following test data to determine if the application is calculating properly: Percentage Fat Percentage of calories from fat: 36% Percentage of calories from fat: 12% (a low-fat food) Calories and Fat Clear 200 calories, 8 fat grams 150 calories, 2 fat grams
Fat Percentage Calculator Create an application that allows the user to enter the number of calories and fat grams in a food. The application should display percentage of the calories that come from 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. (Display the message in a label or a message box.) The application's form should appear similar to the one shown in Figure 4-35. One gram of fat has 9 calories, so: Calories from fat = fat grams 9 The percentage of calories from fat can be calculated as: Percentage of calories from fat = Calories from fat / total calories Fat Percentage Calculater Entor the number of colonos in the food 200 Enter the number of lat grams in the food Parcentage of cainnes that come from tar 300 % Calculate Input validation: Make sure the number of calories and fat grams are numeric, and are not less than 0. 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. Use the following test data to determine if the application is calculating properly: Percentage Fat Percentage of calories from fat: 36% Percentage of calories from fat: 12% (a low-fat food) Calories and Fat Clear 200 calories, 8 fat grams 150 calories, 2 fat grams
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
C# only
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 6 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education