linear motion exercise

In physics, a common useful equation for finding the position s of a body in linear motion at a given time t, based on its inital position s0, intial velocity v0, and rate of acceleration a, is the following:

s = s0 + v0t + 1/2 at2

Write code to declare variables for s0, v0, a and t.

Then assign values to each of these variables: (You can choose.)

Then write the code to compute s based on these values.

Then Print : When s0 is (insert the value you set) and v0 is (insert the value you set) and t is (insert the value you set and a is (insert the value you set) then s is (insert the value you calculated). (Do not worry about formatting the number. It will have many decimal places.)

Then change the value of any two variables s0, v0, a or t.

Then Print : When s0 is (insert the value you set) and v0 is (insert the value you set) and t is (insert the value you set and a is (insert the value you set) then s is (insert the value you calculated). (Do not worry about formatting the number. It will have many decimal places.)

taken from Reges, Stuart and Stepp, Mary, Building Java Programs: A Back to Basics Approach. and modified a bit.