Our weight on different planets in the solar system will differ due to the varying size and mass of each of the planets. Write a C program, weight.c, to compute the weight of a 200 pound person on the following planets, based on the data below:
Planet | Percent of Earth Weight |
Mercury | 37.8% |
Venus | 90.7% |
Mars | 37.7% |
Jupiter | 236.0% |
Saturn | 91.6% |
Uranus | 88.9% |
Neptune | 112.0% |
The program should generate the following outputs:
Mercury: xxx.x
Venus: xxx.x
Mars: xxx.x
Jupiter: xxx.x
Saturn: xxx.x
Uranus: xxx.x
Neptune: xxx.x
Your program should right-justify the planet names and present the output to one decimal place as shown above. Be sure to line up the decimal points. Use the following guidelines to develop your program:
Declare your variables with appropriate data types.
Assign values to your variables.
Perform your calculations.
Generate appropriate output.