Assignment 23 — functional chrestomathics

Due Tuesday October 29


Module beanery.py (code will be available at the start of class)


Function volume( a, b )

jelly bean formula

To make your calculation as accurate as possible, use Python's estimate of π when needed.

volume( 1.3 , 0.7 ): 0.41691552507014545

volume( 2.0 , 1.0 ): 1.3089969389957472



Function count( s, j, f )

jelly beans

count( 0.42 , 125 , 0.7 ): 208

count( 1.31 , 500 , 0.6 ): 229



Function guess( a, b, j )

guess( 1.3 , 0.7 , 125 ): 209

guess( 2.0 , 1.0 , 500 ): 266

guess( 1.52 , 0.9 , 1550 ): 1342

 


 

 

 
   
   
   
 
  © 2019 Jim Cohoon   Resources from previous semesters are available.