Class 27 — Friday March 27

Tasty problem solving

To be, not to be — That is the question we ask – The answer, to be


Look both ways


Agenda


Buddying


Problem set — Homework 24


To do


Set up


Module beanery.py

jelly bean formula

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

volume( 1.3 , 0.7 ): 0.41691552507014545

volume( 2.0 , 1.0 ): 1.3089969389957472



count( 0.42 , 125 , 0.7 ): 208

count( 1.31 , 500 , 0.6 ): 229

  • What built-in function converts a decimal to an integer?
  • Should function volume() be helpful?

guess( 1.3 , 0.7 , 125 ): 209

guess( 2.0 , 1.0 , 500 ): 266

guess( 1.52 , 0.9 , 1550 ): 1342

  • Should function volume() be helpful?
  • Should function count() be helpful?


jelly beans

 


 
  © 2020 Jim Cohoon   Resources from previous semesters are available.