Assignment 9 — problem solving

Due Friday, February 2


Program bean_count.py

jelly bean formula

where a and b are respectively the length and height of the jelly bean.

v F / j

where v, F, and j are respectively the volume of the jar, the loading factor, and the size of one jelly bean.

Two different sample runs

Enter jelly bean length (cm): 1.52

Enter jelly bean height (cm): 0.9

Enter jar size (mL): 500

Estimate of jelly beans in the jar: 433

Enter jelly bean length (cm): 2.0

Enter jelly bean height (cm): 1.0

Enter jar size (mL): 25

Estimate of jelly beans in the jar: 13


jelly beans