Skip to content

Instantly share code, notes, and snippets.

@SniperProSerria117
Created October 30, 2014 13:16
Show Gist options
  • Save SniperProSerria117/c63ac7caf52bf4f92be6 to your computer and use it in GitHub Desktop.
Save SniperProSerria117/c63ac7caf52bf4f92be6 to your computer and use it in GitHub Desktop.
package velocity;
import java.util.Scanner;
public class Velocity {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
double Momentum;
double Mass;
double Velocity;
System.out.print("Enter mass: ");
Mass = reader.nextDouble();
System.out.print("Enter velocity: ");
Velocity= reader.nextDouble();
Momentum = Mass * Velocity;
System.out.print("The momentum is: ");
System.out.print(Momentum);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment