Question: Java Functions The final position of an object falling in a vacuum at time t is x(t) = 0.5at? + Vit + Xi Instead of
Java Functions


The final position of an object falling in a vacuum at time t is x(t) = 0.5at? + Vit + Xi Instead of implementing it in the main method, we have created a function called calculateposition. It looks like this: public static double calculatePosition () { double a = -9. 81; return -1; } The function now has no arguments, and the return value, -1, is just a placeholder a Variable Meaning Value Acceleration (m/s2) -9.81 t Time(s) 10 Initial Velocity (m/s) 0 Xi Initial position 0 Vi Using the above explanation for the variables, modify calculatePosition so that it takes arguments for t, vi, and xi and returns x(t). a will be set already. 2 public class GravityCalculator { 3 40 public static double calculatePosition() { 5 double a = -9.81; 6 return -1; 7 } 8 90 public static void main(String[] args) { 10 11 } 12 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
