Question: In Java When an object is falling because of gravity, to determine the distance the object falls over time, the following formula is used (d=1/2
In Java
When an object is falling because of gravity, to determine the distance the object falls over time, the following formula is used (d=1/2 * g * t^2) (t squared).
d represents the distance (in meters),
g is 9.8,
and t is the time (in seconds)
Write a main that asks the user for the distance in meters. The program should print a table that displays the distance and the time taken to cover that distance. The table should start with distance 1 m and go up to the distance specified by the user. The table should be displayed in increments of 5 meters. Write the table to a file called distance.txt.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
