Question: This is what I have so far: package procedural; public class TimeDilation { //instance variables public double dTime; public double sTime; public static double velocity;

This is what I have so far:
package procedural;
public class TimeDilation {
//instance variables public double dTime; public double sTime; public static double velocity; public static double speedOfLight; //Default constructor public TimeDilation() { dTime = 0; sTime = 10; //years velocity = 50000; speedOfLight = 300000; // km/second } public static double timeDilation(double time, double velocity) { return velocity; } public static void main(String[] args) { //header for the table System.out.println("TIme Dilation for an astronaut traveling for 10 years at different velocities"); System.out.println("Velocity(Km/s)\t % Speed of Light\t Time Dilation(years)"); System.out.println(velocity); System.out.println(speedOfLight); return; }//end main
}//end class
Make a method that will calculate time dilation for a given velocity, V, and time, t. We will assume c, the speed of light, is a constant of 300,000 km/second. Here is what the header to vour method should look like public static double timeDilation(double time, double velocity) Use this method to create a table that shows the time dilation for different velocities. The velocities that we will show in the table will start at 50,000 km/second and go to 300,000 km/second, and increment 10,000 km/second for every row. In the second column output the percent of the speed of light of the velocity in column one. We will assume that the earth time, t, will be a constant 10 years for this table. Here is an example output: Time Dilation for an astronaut traveling for 10 years at different velocities Velocity(km/s) % Speed of Light 50000 60000 70000 80000 90000 100000 110000 17% 20% 23% 27% 30% 33% 7% Time Dilation(years) 9.860 9.798 9.724 9.638 9.539 9.428 9.304 ***middle of the table here*** 270000 280000 290000 300000 90% 93% 9 7% 100% 4.359 3.590 2.560 0.000 Now make the following table that shows the distance in miles/h in the first column, and the time dilation in the second column. You will need to make a method to convert your miles/hour to kilometers/second in order to use the timeDilation method that vou made above - because the equation that was implemented uses kilometers/sec 1 mile 1 hour x 1 hour x 1609344 km 1 mile 1609344 km 3600 sec 3600 sec
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
