Difference between revisions of "Dimensions of a Can of Soup"
Line 3: | Line 3: | ||
|Problem= Your best friend in the whole world rummages through your cupboards and emerges with a can of clam chowder. Being slightly obsessive about measuring objects, your friend uses a measuring tape and concludes that the radius of the can is 4 centimeters and the height is 12 centimeters. Your friend then poses some questions to you: | |Problem= Your best friend in the whole world rummages through your cupboards and emerges with a can of clam chowder. Being slightly obsessive about measuring objects, your friend uses a measuring tape and concludes that the radius of the can is 4 centimeters and the height is 12 centimeters. Your friend then poses some questions to you: | ||
− | + | #What is the surface area of the can? | |
− | + | #What is the volume of the can? | |
− | + | #Can I eat this clam chowder? | |
Being slightly obsessive about using Java to do all of your mathematical computations, you design a program to find answers to these questions. You are also a rebel; You do not like using the Java constant for PI, so you create your own. | Being slightly obsessive about using Java to do all of your mathematical computations, you design a program to find answers to these questions. You are also a rebel; You do not like using the Java constant for PI, so you create your own. |
Revision as of 12:18, 1 April 2010
Back to the Program-A-Day homepage
ProblemYour best friend in the whole world rummages through your cupboards and emerges with a can of clam chowder. Being slightly obsessive about measuring objects, your friend uses a measuring tape and concludes that the radius of the can is 4 centimeters and the height is 12 centimeters. Your friend then poses some questions to you:
Being slightly obsessive about using Java to do all of your mathematical computations, you design a program to find answers to these questions. You are also a rebel; You do not like using the Java constant for PI, so you create your own. |
SideSectionTitle
An image or By Students section | |
---|---|---|
SolutionThe solution... | ||
CodeSolutionCode goes here. Please DO NOT put your code in <pre> tags! |