Project #2
Buoyant Storage
(Due 26 Sep 07)
The East Wind is to be a sailing vessel which carries passengers on adventure trips around the Carribean. The owners want the ship built to their specifications, including various unusual safety features. One of these safety features is to use several metal storage tubes as flotation devices; these tubes must be easily emptied so that they can be thrown overboard in case of an emergency and used like life preservers for anyone in the water. The owners have specified that the tubes must be 6 inches in diameter, be reasonably light and sturdy for storage and be able to support a reasonable amount of weight when in the water. You are to write a program to design the tubes to meet the owners' needs.
The tubes are considered to be hollow cylinders with an outside diameter of 6 inches. The metal shell is to have a uniform thickness throughout the cylinder; one end will have a metal cap to provide access to the storage; but for your program, the thickness will be assumed to be uniform. The program should ask the person at the keyboard (presumably an owner) to specify three things: the length of the tubes (expressed in feet), the amount of weight (in pounds) to be supported in the water, and the specific gravity of the metal to be used in the shell. From these specifications, the program must determine the thickness of the shell, in inches, and the weight of the tubes in pounds.
It turns out that calculating the thickness is a bit messy; the thickness can be calculated as one of the roots of the following equation. But, solving for x needs to be done in several stages. The other symbols in the equation have the following meaning: r is the radius of the tube; h is the height (length) of the tube; t is the weight of the tube; s is the specific gravity of the metal; and w is the weight of a unit volume of water (one cubic foot or one cubic inch).
It is simplest if we do the calculation in pieces. The weight of the tube, t, is the weight of the water equivalent to the volume of the tube minus the amount of weight to be supported (the buoyancy). The volume of the tube is just the formula for a cylinder; to get its water equivalent multiply the volume by the weight of a cubic foot of water (62.42 lbs) if working in feet or by the weight of a cubic inch of water (0.036123 lbs) if working in inches. Let a, b, and c represent the coefficients in the ugly equation above. Thus, a, b, and c are as follows.
The specific gravity of the metal, s
in the equations, is one of the numbers shown in the following table.
The owner at the keyboard must enter one of these four numbers when prompted
for the specific gravity.
| Metal | S. gravity | Attributes |
| Magnesium | 1.738 | Lightest, least sturdy |
| Aluminum | 2.7 | Light and sturdy |
| Titanium | 4.506 | Expensive but very sturdy |
| Stainless steel | 7.48 | Heavy but very sturdy |
It is easier to deal with the calculations if we calculate two intermediate values; I'll call them g and m and then determine an angle (phi) using them. To get phi, you need to calculate the ArcCosine of the value on the right of the last equation. Note that when you get phi, it will be in radians.
Once all of this is calculated, we can finally calculate x for the original equation as
Here is a sample of what your program
should calculate. Suppose the length of the tube is 6 feet, the weight
to support is 50 lbs and the metal is aluminum. Your program should
get these approximate answers.
Weight of tube: 23.5368 lbs
Shell thickness: 0.176493 inches
Approximately three days before the project is due, I will give you two sets of tube specifications that I want you to use when you execute the program.
Hand in a well-documented printout of your
program and a printout of the captured output from the two executions on
the data that I provide. Also, copy the program's .cpp file to the
handin folder on the P: drive for COSC 110 section 003. Be sure to
name the .cpp file after yourself so that it can be distinguished from
other student file names. For example, I would name my file
wolfep2.cpp