Question

In: Computer Science

6) EscapeVelocity In order for an object to escape a planet's gravitational pull, it must attain...

6) EscapeVelocity In order for an object to escape a planet's gravitational pull, it must attain a minimum initial velocity called the escape velocity. The escape velocity varies from planet to planet but it is the same for all objects on a given planet. Assume that we are analyzing the data that a small probe has collected while exploring some mystery planet. The probe has managed to obtain the circumference of the planet and the acceleration due to gravity at the surface. The probe must now determine what initial velocity it requires for takeoff in order to remove itself from the planet's gravitational force. You are to create a Java program that will determine this velocity. Your program should first prompt the user for the circumference of the planet and then the acceleration due to gravity on the planet. From this information, your program should determine the radius, mass, and escape velocity of the planet using the following equations. In these equations, m kg is the planet's mass, r km is the planet's radius, G is the gravitational constant approximated by 6.6726 x 10-11m3 kg-1 s-2 , and a m/s2 is the acceleration due to gravity on the surface of the planet. Your program should read input and print output as shown in the following example. (The values shown after the question marks are supplied by the user.) Circumference (km) of planet? 38000 Acceleration due to gravity (m/s^2) on planet? 9.8

Solutions

Expert Solution

As you didn't tell me how to Format output but I did my best in formatting the answer and if you need further assistance do comment, I'll be happy to help you.

Code

import java.util.*;
import java.lang.Math;

class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner (System.in);

    System.out.println("Welcome to the Escape Velocity Application\n");
    System.out.println("To begin, please enter the following information below\n");
    System.out.println("Circumference (km) of planet? ");
    double circum = input.nextDouble();

    System.out.println("Acceleration due to gravity (m/s^2) on planet? ");
    double acc = input.nextDouble();

    //Gravitational constant
    double G = 6.67408e-11;

    //Radius
    circum = circum*Math.pow(10, 3); // convert km to m
    double r =circum/(2*Math.PI);
   
    //Mass
    double m = acc*(Math.pow(r, 2)/G);

    //Escape Velocity
    double e = (Math.sqrt((2.0*G*(m))/r));
    e = e*Math.pow(10,-3);//converting escape velocity to km/s from m/s
    r = r*Math.pow(10,-3);//converting radius to km from m
    System.out.println("\nCalculating the escape velocity ...");
    System.out.println("\nPlanet radius : "+r+" km");
    System.out.println("\nPlanet mass : "+m+" kg.");
    System.out.println("\nEscape velocity : "+e+" km/s.");

  }
}

Related Solutions

What is the value of escape velocity for a body to escape from.earth gravitational field
Explain escape velocity details. What is the value of escape velocity for a body to escape from earth gravitational field 
Is the sun's gravitational pull on the moon greater or less than the earth's pull on...
Is the sun's gravitational pull on the moon greater or less than the earth's pull on the moon? The sun doesn't steal our moon away, so the earth must be pulling harder, right? If you do the calculation, you find out that's not true. The sun pulls more than the earth, so why don't we lose the moon?
Carla and Jenny are arguing about whether or not it is possible to escape the gravitational...
Carla and Jenny are arguing about whether or not it is possible to escape the gravitational field of the Earth. Carla shows Jenny a system where mass m is rE (not the Earth's radius) distant from Earth and rP (not planet P's radius) distant from planet P, the mass being on the line connecting the Earth and planet P. Carla states that the mass m has escaped if FP on m = −FE on m. Jenny disagrees. Which one, if...
An object is at rest on the ground. The object experiences a downward gravitational force from Earth.
An object is at rest on the ground. The object experiences a downward gravitational force from Earth. Which of the following predictions is correct about why the object does not accelerate downward? Select two answers. Justify your selections.A) The bonded molecules of the object are repelled upward by the bonded molecules of the ground with the same magnitude as the gravitational force downward on the object.B)The normal force is exerted upward on the object from the ground with the same...
The gravitational force exerted on a solid object is 5.70 N. When the object is suspended...
The gravitational force exerted on a solid object is 5.70 N. When the object is suspended from a spring scale and submerged in water, the scale reads 2.10 N (figure). Find the density of the object.
What must be the position of an object in order that it may be seen distinctly...
What must be the position of an object in order that it may be seen distinctly through a +9.0 D lens placed 2.9 cm in front of an eye, the eye being accommodated for a distance of 35.5 cm? Give your answer in cm as a distance to the lens.
Besides the gravitational force, a 2.50-kg object is subjected to one other constant force. The object...
Besides the gravitational force, a 2.50-kg object is subjected to one other constant force. The object starts from rest and in 1.20 s experiences a displacement of (5.40î − 3.30ĵ) m, where the direction of ĵ is the upward vertical direction. Determine the other force.
26.1) How many electrons must be added or removed to an uncharged object in order to...
26.1) How many electrons must be added or removed to an uncharged object in order to give the object a charge of: (a) -1.1 x 10-14 C (b) 8 x 10-19 C 27.2 ) Two charged metal spheres are fixed in place 1 m apart. Sphere A has a charge of + 1 mC while sphere B has a charge of + 2 mC. (a) What is the electric force on sphere A (in N) ? (b) What is the...
Part A How fast must an object travel for its total energy to be 6 %%...
Part A How fast must an object travel for its total energy to be 6 %% more than its rest energy? Express your answer using two significant figures. Part B How fast must an object travel for its total energy to 94 %% more than its rest energy? Express your answer using two significant figures.
To what height would a 3.0 kg object have to be raised such that its gravitational...
To what height would a 3.0 kg object have to be raised such that its gravitational potential energy would equal the kinetic energy it would possess if it were moving at 3.0 m/s?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT