10. (4 pts) In physics, the escape velocity from a spherical planet (are there n
ID: 3749188 • Letter: 1
Question
10. (4 pts) In physics, the escape velocity from a spherical planet (are there non-s be computed using the formula pherical planets?...) can 2GM where G is the universal gravitational constant, M is the mass of the planet, and r is the distance from the planet's center of mass. Assume that you have double variables named G, M, and r with values already line of Java code that assigned. Write a singls computes the escape velocity based on those three variables and assigns it to a new double variable named v. Be sure to declare v. 11. (5 pts) Convert (11010)2 into base 10. Please show all your work! Minimal credit will be given for a solution that involves only counting. (5 pts) Check your result from the previous problem by converting it back into base 2. Again, please show all your work 12.Explanation / Answer
Solution:
10.
public class EscapeVelocity {
public static void main(String[] args) {
//Declaring and Initializing the values of G,M,and R
final double G = 6.673 * Math.pow(10, -11); //Universal Gravitational Constant (6.67 x 10-11 m3 kg-1 s-2)
final double M = 5.98 * Math.pow(10, 24); //mass of the planet or moon (5.98 x 10^24 Kg)
final double R = 6.38 * Math.pow(10, 6); // Radius of the planet i.e (6.38 x 10^6 m)
//Using Escape Velocity formula i.e v = sqrt(2GM/R)
double v = Math.sqrt(2*G*M/R);
//Printing out the escape velocity.
System.err.println("Escape velocity is "+v+"m/s");
}
}
Sample Run:
Escape velocity is 11184.480402811645m/s
11.
( 11010 )2 = ( 26 )10
Explanation
Step 1:
Start at the rightmost digit. Take that digit and multiply with 20 (20 = 1). Multiple second digit with 21, third with 22...
In this example we have:
Step 2:
Add together all products
0 + 2 + 0 + 8 + 16 = 26
12.
Now lets do vice versa to prove
( 26 )10 = ( 11010 )2
Explanation
Step 1:
Write down the decimal number and continually divide by 2 to give a result and a remainder. The remainder is either a 1 or a 0.
In this example we have:
Step 2:
Read the remainders from bottom to top. i.e 11010
Note: I hope you understood the solution, If you need further details please do comment below, if you liked the solution then please do give a thumbs up.
0 * 20 = 0 * 1 = 0 1 * 21 = 1 * 2 = 2 0 * 22 = 0 * 4 = 0 1 * 23 = 1 * 8 = 8 1 * 24 = 1 * 16 = 16Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.