The major formula of interest here is:
Payload = BalloonLift - BalloonWeightwhere 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:
- Choose between spherical and sausage balloon design computations.
- For spherical balloons, input a diameter and get back a payload capacity.
- For spherical balloons, input a payload capacity and get back the required diameter.
- For sausage balloons, input a diameter and a length and get back a payload capacity.
- For sausage balloons, input a payload capacity and a diameter and get back a length.
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.