Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You may remember from high school science that while mass is a constant, weight is dependent on mass multiplied by how strong the gravitational pull

You may remember from high school science that while mass is a constant, weight is dependent on
mass multiplied by how strong the gravitational pull of the planet is. So, if you were to travel to
different planets, the weight of an object would change. In this lab, you are asked to compute just how
much an object would weigh on the other planets in our solar system.
Here is the table of relative gravitational strength as compared to earth:
Planet Relative Strength
Mercury 0.38
Venus 0.91
Mars 0.38
Jupiter 2.54
Saturn 1.08
Uranus 0.91
Neptune 1.19
What you need to do
Your task is to write a program which asks the user to input a weight and displays that weight scaled
appropriately on each of the other 8 planets
Example
Please enter the weight youd like to convert: 100
Here is the weight on other planets:
Mercury 38 lbs
Venus 91 lbs
Mars 38 lbs
Jupiter 254 lbs
Saturn 108 lbs
Uranus 91 lbs
Neptune 119 lbs
Redirect the output to a file named lab2b.txt Note that when you do this, the program wont display
text on the screen anymore. Youll still need to type a number in and hit enter. This wont be captured
by the redirection either. Thats expected behavior.
For an extra challenge, right align the column of numbers using the proper scan code format.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago