Question: Write a C++ program that asks the user to input the gravitational constant, the mass of the planet or star and the radius of the

Write a C++ program that asks the user to input the gravitational constant, the mass of the planet or star and the radius of the planet or star. It should display a report similar to the following:

  • Gravitational Constant:

0.0000000000667

  • Mass:

73500000000000000000000

  • Radius:

1740000

  • Escape Velocity:

2373.815494093843849

  • Print a welcome message to the user

  • Allow users to input the gravitational constant, the mass of the planet or star, and the radius of the planet or star.

  • Calculate the escape velocity and display the results as shown above

  • You are required to only display all output to 15 decimal places. You are required to line up the output values.

  • Include comments in your code as required.

  • You may assume that all user input will be correct (i.e. numeric entries and valid dimensions). You do not need to handle any situation in which the user enters a negative value, or a letter (Character).

  • No global variables (variables outside of main() )

  • All input and output must be done with streams, using the library iostream

  • You may only use the iostream, iomanip, string, and cmath libraries (you do not need any others for these tasks)

NO C style printing is permitted. (Aka, dont use printf). Use cout if you need to print to the screen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!