Code in VMware Fusion?
Problem #1: Space Cadet!
On the moon the gravitational force is less, which means a person only weighs 1/6 of their normal weight on the moon. Prompt the user for their weight and then tell them what they would weigh on the surface of the moon.
• User Input (Ask & Validate In Main Method, Use As Arguments): o Astronaut’s weight (in pounds)
• Return Value From Custom Function: o Weight On The Moon
• Result To Print To The Console In The Main Method:
o “On Earth you weigh X lbs, but on the moon you would only weigh Y lbs.”
• Data Sets To Test
o Astronaut’s Weight – 160
§ Results-“OnEarthyouweigh160lbs,butonthemoonyouwouldonly weigh 26.67 lbs.”
o Astronaut’s Weight – 210
§ Results-“OnEarthyouweigh210lbs,butonthemoonyouwouldonly
weigh 35 lbs.”
o Astronaut’s Weight – One Hundred Pounds
§ Results–Re-promptfornumbervalue.
o Test one of your own and put all 4 of these test values in a multi-lined
comment at the end of your code.