Assignment 9 — problem solving

Due Monday, September 17, extended to Tuesday, September 18


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