Describe the solution to the following problem using the Hierarchy chart and a Java program. We...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
Heres the hierarchy chart for the given algorithm Main Algorithm Input Module Calculation Module Acc... View the full answer
Related Book For
Introduction to Management Science A Modeling and Cases Studies Approach with Spreadsheets
ISBN: 978-0078024061
5th edition
Authors: Frederick S. Hillier, Mark S. Hillier
Posted Date:
Students also viewed these operating system questions
-
The Hershey Company uses futures to lock in the cost of cocoa products it needs to produce its products. Hershey forecasts that it will need 500 tons of cocoa in 90 days to manufacture its products....
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Being able to identify an industry to use for benchmarking yourfirm's results with similar companies is frequently not easy. Choose a type of business and go to www.naics.com. This Web site allows...
-
Purdue Savings and Loan Association purchased a put option on Treasury bond futures with a September delivery date and an exercise price of 91-16. Assume the put option has a premium of 1-32. Assume...
-
In each of the following independent situations, determine how much, if any, qualifies as a deduction for AGI under 222 (qualified tuition and related expenses). a. Lily is single and is employed as...
-
Explain the reason the Genetic Information Nondiscrimination Act was enacted.
-
A diet center claims that it has the most effective weight loss program in the region. Its advertisements say, Participants in our program lose more than 5 pounds within a month. Six clients of this...
-
ABC firm has a ROA of 15%, Net Profit Margin of 2% and ROE of 19%. What is its Equity Multiplier?
-
A work sheet for Juanita's Consulting is shown on the following page. There were no additional investments made by the owner during the month. REQUIRED 1. Prepare an income statement. 2. Prepare a...
-
A potential difference of 0.040 V is developed across the 10-cm-long wire of (Figure 1) as it moves through a magnetic field perpendicular to the plane of the figure. Figure 1of1 > Part A What is the...
-
Find a function whose order of growth is larger than any polynomial function, but smaller than any exponential function. Extra credit: Find a program whose running time has that order of growth.
-
Create a new constructor so that Queue \(r=\) new Queue \((q)\); makes \(r\) a reference to a new and independent copy of the queue \(q\).
-
Given an array of \(n\) integers, design a linearithmic-time algorithm to determine whether any two of them sum to 0 .
-
Write a method that takes the first Node in a linked list as its argument and reverses the list, returning the first Node in the result.
-
Finding a repeated integer. (a) Given an array of \(n\) integers from 1 to \(n\) with one value repeated twice and one missing, give an algorithm that finds the missing integer, in linear time and...
-
Determine the reaction at point A in the t direction in N? Set P 695 N, w= 332 N/m? Note: the figure is not to scale and your answer should contain only numbers, not units.
-
a. Assuming that all clocks produced are sold, develop a spreadsheet model for estimating the profit or loss from producing any particular number of clocks. b. Use this spreadsheet to find the...
-
Reconsider Problem 6.5. Suppose now that, for administrative convenience, management has decided that all 130 units per month needed at the distribution center in Los Angeles must come from the...
-
You are given the following linear programming model in algebraic form, where x1 and x2 are the decision variables and Z is the value of the overall measure of performance. Maximize Z = x1 + 2x2...
-
Enter the following transactions of an antiques shop in the accounts and extract a trial balance as at 31 March 2017. 2017 March 1 Started in business with 8,000 in the bank. 2 Bought goods on time...
-
Record the following details relating to a carpet retailer for the month of November 2017 and extract a trial balance as at 30 November 2017. 2017 Nov 1 Started in business with 15,000 in the bank. 3...
-
Record the following transactions for the month of January of a small finishing retailer, balance-off all the accounts, and then extract a trial balance as at 31 January 2016. 2016 Jan 1 Started in...
Study smarter with the SolutionInn App