Monday
October 20, 2014

Homework Help: Computer programming

Posted by Viper on Monday, April 4, 2011 at 8:48pm.

Submit pseudocode for the following programming exercise:

Fat Gram Calculator

Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows:

- Make sure the number of fat grams and calories are not less than 0.

- According to nutritional formulas, the number of calories cannot exceed fat grams X 9. Make sure that the number of calories entered is not greater than fat grams x 9.

Once correct data has been entered, the program should calculate and display the percentage of calories that come from fat. Use the following formula:

Percentage of calories from fat = (fat grams x 9) / calories

Some nutritionists classify a food as low fat if less than 30 percent of its calories come from fat. If the results of this forumlas are less than 0.3, the program should display a message indicating the food is low in fat.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Programming - Submit pseudocode and a flowchart for the following programming ...
Fat gram calculator - Design a program that asks the user for the number of fat ...
Computer Programing & Logic Design - Submit pseudocode and a flowchart for the ...
Math - Coould someone please let me know if I did this equation correctly. This ...
Sic / 241 - Can u please tell me if i figured this right? Part B: Calculating ...
Computer Programing & Logic Design - Submit pseudocode and a flowchart for the ...
Computer Programing & Logic Design - Submit pseudocode and a flowchart for the ...
Computer Programing & Logic Design - Submit pseudocode and a flowchart for the ...
math - how can i make the content equal the same %? what did i do wrong? Lunch: ...
math - how can i make the content equal the same %? what did i do wrong? Dinner...

Search
Members