A. Many jam recipes measure the amount of fruit and white sugar required in cups, for...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A. Many jam recipes measure the amount of fruit and white sugar required in cups, for example. Other recipes use kilograms of fruit and white sugar, for example. Give an algorithm that will determine which recipe uses more white sugar. (Note: Pay attention to what type of sugar your recipe uses!) B. Suppose you have a calculator with no square root button, but you really need to calculate √x. What do you do? You guess! (Carefully, of course.) For example, suppose you need to calculate √27. You would first guess that 1 is your answer. Definitely not close enough because 1² is not close to 27. A second better guess is (1 +27/1)/2, which is 14. Still not close enough because 14² is not close to 27. A third better guess is (14+27/14)/2 = 7.9642..., which is still not close enough, but is closer! Keep going until your guess is accurate enough. If a particular guess, n, is not close enough to being an accurate square root of a number x, we can produce a new and better guess by calculating (n +x/n) / 2. For your algorithm, "accurate enough" means accurate to three decimal places. A. Many jam recipes measure the amount of fruit and white sugar required in cups, for example. Other recipes use kilograms of fruit and white sugar, for example. Give an algorithm that will determine which recipe uses more white sugar. (Note: Pay attention to what type of sugar your recipe uses!) B. Suppose you have a calculator with no square root button, but you really need to calculate √x. What do you do? You guess! (Carefully, of course.) For example, suppose you need to calculate √27. You would first guess that 1 is your answer. Definitely not close enough because 1² is not close to 27. A second better guess is (1 +27/1)/2, which is 14. Still not close enough because 14² is not close to 27. A third better guess is (14+27/14)/2 = 7.9642..., which is still not close enough, but is closer! Keep going until your guess is accurate enough. If a particular guess, n, is not close enough to being an accurate square root of a number x, we can produce a new and better guess by calculating (n +x/n) / 2. For your algorithm, "accurate enough" means accurate to three decimal places.
Expert Answer:
Answer rating: 100% (QA)
A To determine which recipe uses more white sugar you need to convert the measurements to a common u... View the full answer
Related Book For
Fundamentals of Physics
ISBN: 978-0471758013
8th Extended edition
Authors: Jearl Walker, Halliday Resnick
Posted Date:
Students also viewed these programming questions
-
Can a project be 'on time', and 'on budget' and still be considered a failure, despite delivering 100% of its scope? 2. Is it possible for a project to be over budget, delivered late, missing scope,...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Read the case study "Southwest Airlines," found in Part 2 of your textbook. Review the "Guide to Case Analysis" found on pp. CA1 - CA11 of your textbook. (This guide follows the last case in the...
-
howwould I work these out? (a) Calculate the amount of direct materials purchased during the period. Direct materials purchased (b) Calculate the cost of goods manufactured during the period. Costs...
-
The pipe of mass M is supported at A by a system of five cords. Determine the force in each cord for equilibrium. Given: M = 30 kg c = 3 g = 9.81 m/s2 d = 4 θ = 60 deg B E
-
State the domain and range for the following relation. Then determine whether the relation represents a function. {(-2,4), (1,2), (0,0), (1,2)} The domain of the relation is . (Use a comma to...
-
Statistical distance between records can be measured in several ways. Consider Euclidean distance, measured as the square root of the sum of the squared differences. For the first two records in...
-
Using the information for Sarot, Inc., in SE 4 and SE 5 compute the profit margin, asset turnover, return on assets, and return on equity for 2011 and 2012. In 2010, total assets were $400,000 and...
-
Translate the following code into MIPS code. int Sum (int a) { } if (a <3) return (1); else return (a + Sum (a - 2) + Sum (a-3));
-
A restaurant serves 30 guests in four hours and 3 servers (labor), the labor rate is $20/hour/server, and consumes $500 worth of food and other raw materials, and $50 of energy. Calculate...
-
The chief accountant of Thomas Co. has made the following estimations about the probability of collection for accounts receivable: 97% for balances under two months old, 90% for balances two to three...
-
Mary Pierce is the controller of Arnold Corporation and is responsible for the preparation of the year-end financial statements. The following transactions occurred during the year. (a) Bonuses to...
-
What is the difference between a firms gross profit and its net income?
-
Speculate on how the vestibular system might be involved in space sicknessthe feeling of nausea and disorientation that astronauts experience.
-
Is it correct to say that the planets of the solar system are simply projectiles falling around the Sun?
-
Why does spreading feet apart help a surfer stay on the board?
-
Altex Corporation - Case Study BACKGROUND Following World War II, the United States entered into a Cold Warwith Russia. To win this Cold War, the United States had to developsophisticated weapon...
-
1. Advertising for eyeglasses _________ (increases/decreases) the price of eyeglasses because advertising promotes _________. 2. An advertisement that succeeds in getting consumers to try the product...
-
If in a two-slit interference pattern, there are 8 bright fringes within the first side peak of the diffraction envelope and diffraction minima coincide with two-slit interference maxima, then what...
-
High-power lasers are used to compress plasma (a gas of charged particles) by radiation pressure. A laser generating radiation pulses with peak power 1.5 x 103 MW is focused onto 1.0 mm2 of...
-
Two charged, parallel, flat conducting surfaces are spaced d = 100 cm apart and produce a potential difference V = 625 V between them. An electron is projected from one surface directly toward the...
-
Give a superclass for the following three classes: car, airplane, tank.
-
Explain the difference between multiple and simple inheritance and provide one example of each.
-
What is the difference between the operations of a class and its attributes?
Study smarter with the SolutionInn App