Fehringer+Java+Code

__**Final Project**__
package finalproj; import java.util.Scanner; public class PhysicsVelocity { /** This program uses a kinematic equation to find the final velocity of an object moving in space. It collects all the data needed.


 * Made by Eric Fehringer


 * Note: The explanation for each line is under it.



public static void main(String[] args) {

System.out.println("Using the Distance travled, the initial velocity, and the Acceleration; ");

//tells user what program will do//

//System.out.println("We shall find the final Velocity.");//

continuation since first part was too long for one line

Scanner kbd = new Scanner(System.in);

//allows keyboard inputs//

//System.out.print("What is the initial Velocity?");//

asks user for input

double initialvelocity = kbd.nextDouble;

//creates the user input into a variable//

//System.out.print("How far did it travel?");//

asks user for input

double distancetraveled = kbd.nextDouble;

//Creates variable for user input//

//System.out.print("What was the acceleration?");//

asks user for input

double acceleration = kbd.nextDouble;

//creates a variable for input//

//double variable = initialvelocity + (acceleration*distancetraveled*2);//

creates a variable of half the equation

double finalvelocity = Math.sqrt(variable);

//makes a final variable to put as the answer//

//System.out.print("The Final Velocity is: ");//

adds some writing so the user understands it is the answer

System.out.print(finalvelocity);

// gives the answer to the equation to the right of the writing } }