Question: In Java Code, An object in motion, when subjected to gravity (and neglecting air resistance), we can use the following formula to calculate its vertical
In Java Code,
An object in motion, when subjected to gravity (and neglecting air resistance), we can use the following formula to calculate its vertical position after a specific time period (with upwards defined as +):

The terms in the formula are defined as follows; use integers for all values:
d is the distance object falls (meters) in time t (it has fallen in seconds)
g is the gravitation constant (for earth at sea level, 9.8 meters per second - squared)
v0 is the objects initial vertical velocity (in meters per second)
Write a method called verticalDistance that accepts an objects initial vertical velocity (in m/s) and time since released (in seconds) as arguments. The method should return the distance (in meters) that the object has fallen during the time interval. Demonstrate the method by calling it in a program that asks the user to enter values for initial velocity and time elapsed; then use a loop to generate and display all integer combinations of initial velocity and time elapsed from 0 (each) to the user-entered values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
