|
Ok here is the problem...Write a C++ program that allows users to enter the percentage of the moons face that appears illuminated, and that outputss the surface area of that portion of the moon. The formula for the surface area of a segment of a sphere is
S= 2 * (radius * radius) * angle of wedge in radians
There are two radians in a circle, so the hemisphere of the moon that we see accounts for at most 3.1415927 radians. Thus if the user enters 100% (full moon) the angle of wedge is 3.1415927=
S= 2 * (1738.3 * 1738.3) * 3.1415927= 18985818.672 square kilometers
If the user enters 50%(first or first quarter) then the angle of the wedge is 3.415927 * 0.5 and so on. Be sure to use proper formating and appropriate comments in your code. Provide appropriate prompts to the user. The output should be labeled clearly and formatted neatly ( limit the decimal precision to three places as in the example above.
Please help me.
|
|
|
|
|
|
|
|