For this lab, you will write a program to determine how many licks it takes to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
For this lab, you will write a program to determine how many licks it takes to get to the chewy center of a Tootsie Pop™. You will use both a while loop and a for loop to display how much of the outer shell remains after each lick. Algorithm Get radius of whole Tootsie Pop, radius of inner center (millimeters) • Get volume removed by each lick (cubic millimeters) ● ● ● Calculate volume of chewy center and of whole Tootsie Pop o Subtract to find volume of hard outer shell Display center and shell volumes Using a while loop, Remove one lick's worth volume from outer shell Compute new radius of outer shell O o o Display every tenth radius pair, along with lick number o Repeat till outer shell radius equal to (or just slightly less) than center radius Display final lick count and radii Using original volume of shell, mathematically compute how many licks it takes Using a for loop, o Repeat first three steps of while loop actions above Display final lick count and radii Volume Formula The formula to calculate volume of a sphere is: v = 4/3 πr³ In order to find the radius, give a volume, you'll have to do a little algebraic rearranging of the formula, solving for r. For this lab, you will write a program to determine how many licks it takes to get to the chewy center of a Tootsie Pop™. You will use both a while loop and a for loop to display how much of the outer shell remains after each lick. Algorithm Get radius of whole Tootsie Pop, radius of inner center (millimeters) • Get volume removed by each lick (cubic millimeters) ● ● ● Calculate volume of chewy center and of whole Tootsie Pop o Subtract to find volume of hard outer shell Display center and shell volumes Using a while loop, Remove one lick's worth volume from outer shell Compute new radius of outer shell O o o Display every tenth radius pair, along with lick number o Repeat till outer shell radius equal to (or just slightly less) than center radius Display final lick count and radii Using original volume of shell, mathematically compute how many licks it takes Using a for loop, o Repeat first three steps of while loop actions above Display final lick count and radii Volume Formula The formula to calculate volume of a sphere is: v = 4/3 πr³ In order to find the radius, give a volume, you'll have to do a little algebraic rearranging of the formula, solving for r.
Expert Answer:
Answer rating: 100% (QA)
import math def getvolumeradius return 4mathpiradius33 def getradiusvolume return volume34mathpi033 ... View the full answer
Related Book For
Posted Date:
Students also viewed these algorithms questions
-
Write a program to determine how a Windows kernel writeFile () operation treats bytes that are interior to a byte stream. Does the writeFile () operation insert a block of characters, over-write a...
-
Using EES (or other) software, write a program to determine the mole fractions of the components of a mixture of three gases with known molar masses when the mass fractions are given, and to...
-
For this assignment you will write a program that inserts 20 random integers from 0 to 100 in order in a linked list object. The program will create another linked list, but with 15 random integers...
-
Case Study 1?1 Amazon in 2019 Answer the five questions at the end of the case. Thepurpose of this case, and others you will be assigned, is toillustrate the application of the concepts covered in...
-
Use the Excel output in Figure 14.9(d) to do (1) through (6) for each of 0, 1, 2. and 3 Figure 14.9(d) (d) Excel output for the hospital labor needs case (sample size: n = 16) Intercept XRay (x1)...
-
Discuss the accuracy of the following statement: The Balanced Scorecard approach is incomplete because it does not include measures on environmental performance and measures of employee health and...
-
What is the mirror-image rule?
-
Kentwood Electronics manufactures three components for stereo systems: CD players, tape decks, and stereo tuners. The wholesale price and manufacturing cost of each item are shown in the following...
-
DataBase managment design. Do the dowsings: 1. Run the sql commands written in ddl.sql file attached 2. Create_a dummy data. You can use "fake data generators" 3. Write followings - Write the query...
-
City Tours Ltd. needs to update the database on a regular basis. As a customer service manager for the company, you need to add new customers and confirmations, update basic costs, delete...
-
You are comparing the regression output across two publicly-traded companies. Both regressions were run using monthly data for 5 years and against the S&P500 with the returns on each companys...
-
A blue car travelling at 8 0 km / - 1 west is passed by a red car travelling in the same direction at 1 0 0 km / - 1 . - What is the velocity of the red car relative to the blue car? - What is the...
-
In 2020 Q3 , what is the most popular product? a. Google Clear Framed Blue Shades b. Google F/C Longsleeve Charcoal c. Google Clear Pen 4-Pack d. Google Utility Backpack
-
(1) Prompt the user for a title for data. Output the title. (1 pt) Ex: Enter a title for the data: Number of Novels Authored You entered: Number of Novels Authored (2) Prompt the user for the headers...
-
Attaching a 24 kg counterweight to the end of a spring stretches it 0.2 m. Describe the equation of motion when the counterweight is released from the equilibrium position with an initial downward...
-
A bank has $100 in assets and a net worth of $100. Suppose that the bank doesn't have to hold any reserves and that assets earn 3%. a. How much is this bank earning on its bank capital? (Enter your...
-
Beam ABCD is pin-supported and roller-supported at points A and C, respectively, as shown in Figure A. It is made with a hollow-rectangle cross section, as shown in Figure B. The beam has yield...
-
Don Griffin worked as an accountant at a local accounting firm for five years after graduating from university. Recently, he opened his own accounting practice, which he operates as a corporation....
-
Programmer-scheduled thread packages allow the programmer to control when each thread is executed and when it must wait. Calls to the thread package (executed by a thread) allow the programmer to...
-
What factors could influence the size of the virtual address space in a modern computer system? In your answer, consider the memory-mapping unit, complier technology, and instruction format.
-
Suppose process P 0 uses variables V 0 and V 1 at the same time, process P 1 uses variables V 1 and V 2 at the same time, and process P 2 uses variables V 2 and V 0 at the same time. Further, P 0 , P...
-
How is elasticity related to the revenue from a sales tax?
-
University of Richmond Professor Erik Craft analyzed the states pricing of vanity plates. He found that in California, where vanity plates cost an average of $28.75, the elasticity of demand was...
-
For each of the following goods, state whether it is a normal good, a luxury, a necessity, or an inferior good. Explain your answers. a. Vodka. d. Perfume. b. Table salt. e. Beer. c. Furniture. f....
Study smarter with the SolutionInn App