Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Describe the solution to the following problem using the Hierarchy chart and a Java program. We are required to determine how many calories a food

image text in transcribed

Describe the solution to the following problem using the Hierarchy chart and a Java program. We are required to determine how many calories a food item has per serving due to its fat content. The algorithm accepts the name of food item, the number of grams of fat and the number of servings. Calculate the number of calories in the food item due to fat content, which is computed by multiplying fat grams and calories per gram. Assume the calories per gram are 9. Now, calculate the number of fat calories per serving (use division) and display it. You are required to design the modular program - a module to take inputs, a module to calculate number of calories and a module for calories per serving. Think about using a constant as well. Make the hierarchy chart for the above algorithm to show relationships between modules. For reference, here are the two sample output screen shots. 1. Enter name of food item, fat grams and number of servings: pizza 275 8 Calories in Pizza per serving: 309.37 2. Enter name of food item, fat grams and number of servings: fish 206 3 Calories in Fish per serving: 618.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

=+21.4. 20.141 Show that the Cauchy distribution has no mean.

Answered: 1 week ago