Question: For this lab, you will write a program to determine how many licks it takes to get to the chewy center of a Tootsie

For this lab, you will write a program to determine how many

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.

Step by Step Solution

3.43 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import math def getvolumeradius return 4mathpiradius33 def getradiusvolume return volume34mathpi033 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!