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...
-
Test to see if the population mean annual salary for men differs from that for women.
-
An affiliative leadership style is most useful when a radical change in corporate vision is needed. a) True b) False
-
The June 30, 2010, adjusted trial balance of Energized Espresso, Inc., is shown next. Requirements 1. Prepare the June closing entries for Energized Espresso, Inc. 2. Calculate the ending balance in...
-
The real risk-free rate of interest is 3 percent. Inflation is expected to be 2 percent this year and 4 percent during the next 2 years. Assume that the maturity risk premium is zero. What is the...
-
Sales Expenses Avoidable Unavoidable Total expenses Income (loss) Department B $ 129,360 21,200 105,200 126,400 Department R $ 73,200 75,680 Department S $ 115,360 Department V $ 87,040 Department X...
-
The flowchart below shows the August production activity of the punching and bending departments of Wire Box Company. Use the amounts shown on the flowchart to compute the missing numbers identified...
-
The figures calculated below are only an approximation of net cash upon closing. Although every effort has been made to allow for variances and accuracy, we cannot guarantee same. Property: Client:...
-
Explain how a change in interest rates in the economy would be expected to affect each component of the weighted average cost of capital.
-
List the five possible procedures for dealing with real options.
-
Briefly describe the tax depreciation system under MACRS.
-
How widely used is real option analysis?
-
Explain how growth options are like call options.
-
a. In computer networking, the Network Layer can ensure correct delivery of data from source to destination (end-to-end communication). Why is Transport Layer still needed? Describe 3 reasons of...
-
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...
-
The circular spring clamp produces a compressive force of 3 N on the plates. Determine the maximum bending stress produced in the spring at A. The spring has a rectangular cross section as shown. 10...
-
Determine the maximum compressive force the spring clamp can exert on the plates if the allowable bending stress for the clamp is allow = 4MPa. The spring has a rectangular cross section as shown....
-
The ceiling-suspended C-arm is used to support the X-ray camera used for medical diagnoses. If the camera has a mass of 150 kg, with center of mass at G, determine the maximum bending stress at...
Study smarter with the SolutionInn App