Program 8, Out of THIS world

Short Description:

Write a program which will compute the user's weight on another planet or stellar body.

This assignment is worth 50 points.

Goals

When you finish this homework, you should:

Formal Description

Please write a program to match the specifications for program 4 page 239 of your book:
Write a program that asks the user to enter his or her weight on earth and the name of a planet or other body. The program then outputs how much the user would weigh on that planet or body. The following table gives the factor by which the weight must be multiplied for each planet.
PlanetFactor
Mercury 0.4155
Venus 0.8975
Earth 1.0
Moon 0.166
Mars 0.3507
Jupiter 2.5374
Saturn 1.0677
Uranus 0.8947
Neptune 1.1794
Pluto 0.0899

Your program should first prompt for the user's weight, then for the planet.

Your program should output the weight correct to four decimal places. This should be on a line proceeded by the phrase "New Weight: ". The phrase "New Weight: " should not appear in any other location in your input/output. If the user does not enter a correct planet name, the program should print "New Weight: unknown" I will deduct major points if you do not follow this specification.

Example Runs:

Please enter your weight on Earth => 100
Please enter your destination planet => Moon
New Weight: 16.6000

Please enter your weight on Earth => 100
Please enter your destination planet => MOON
New Weight: unknown 

Please enter your weight on Earth => 100
Please enter your destination planet => Sun 
New Weight: unknown 

Discussion

Your identifiers should be constructed properly, with meaningful names.

You should document your code with comments.

Your output should be organized, easy to read, and make appropriate use of white space.

You should use appropriate named constants. (const string MARS="Mars" is NOT an appropriate named constant)

Planet names should be as specified in the book, the case must match (for now).

Required Files

A single source code file.

Submission

Email your final source code file to dbennett@edinboro.edu.