CS 101 Laboratory Programming Assignment Three

Helium Balloon Design

You have been asked by a world-famous balloon adventurer to help him design a helium balloon for his next around-the-world attempt. He's not sure yet exactly what payload capacity he will need, but while he's figuring that out, you decide to create an interactive program to help you optimize the design.

The major formula of interest here is:

Payload = BalloonLift - BalloonWeight
where payload, weight, and lift are measured in pounds.

The balloon lift is equal to the balloon volume times the helium lift factor (0.053 lb/ft3).

The balloon weight is equal to the surface area of the balloon times the skin thickness (0.000333 ft) times the skin density (44 lb/ft3).

Your adventurer friend wants to have designs available for both spherical and sausage-shaped balloons. The sausage-shaped balloon can be represented by a cylinder with hemispherical end caps. To assist in the design optimization process your program should allow the following types of interactivity:

You should detect all nonsense conditions and scold the user accordingly. For example, a sausage balloon cannot be shorter than its diameter.

Along with your commented source code, turn in a sample session for three different designs to lift a 4000 lb payload (sphere balloon and two different sausage balloons).

You may this function in your program. Be sure to attribute its source in your programmer's block if you use it. See the bottom of the syllabus page for instructions on how to provide proper attribution. You don't have to use the provided function if you don't want to.



This page established January 31, 1999; last updated February 8, 1999.