Psuedocode Example-Fat Calculator problem statement

Psuedocode Example-Fat Calculator problem statement - OK....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
INFO 250-Pseudocode for Fat Calculator Problem Problem Statement: Application that takes entry of calories and number of fat grams in a food item. If either of these entries are missing, then a request for entry is displayed. With entry, the number of fat calories and fat percentage is calculated. If the fat percentage is greater than 0.3, a message is displayed that says that the food item is high in fat; otherwise that the food is
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: OK. Psuedocode: Caluculate_fat_percentage Prompt for calories Get calories Prompt for fat_grams Get fat_grams IF calories IS null OR fat_grams IS null THEN Display entry_message ELSE Calculate fat_calories = fat_grams * 9 Calculate fat_percentage = (fat calories/calories) * 100 Display fat_calories Display fat_percentage IF fat_percentage > 0.3 Display food_high_fat_message ELSE Display food_OK_message ENDIF ENDIF END...
View Full Document

This note was uploaded on 04/13/2008 for the course INFO 250 taught by Professor Whitcomb during the Spring '08 term at Texas A&M.

Ask a homework question - tutors are online