Question: The gravitational attraction between any two objects in the universe is given by the following formula: 2. Force of Gravity = (G * m *

 The gravitational attraction between any two objects in the universe is

The gravitational attraction between any two objects in the universe is given by the following formula: 2. Force of Gravity = (G * m * n) / r2 Where m and n are masses of the objects in kilograms, r is the distance between them in meters, and G is the gravitational constant 6.67 10-11 Write a program that prompts the user to enter m, n, and r, then calculates and prints the Force of Gravity if the user inputs are valid Use two-way selection (if-else) with logical operator (AND/ OR) structure to validate the user inputs. Display an error message if the inputs are invalid Basically, if all three values (m, n, and r) are greater than 0, they are valid. If one of them is less than or equal to 0, they are not valid. tems

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!