Skip to content

Instantly share code, notes, and snippets.

@vincentius15
Last active March 9, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentius15/990213b9fe5e8c9aec23a46ff35422da to your computer and use it in GitHub Desktop.
Save vincentius15/990213b9fe5e8c9aec23a46ff35422da to your computer and use it in GitHub Desktop.
public class MovingObject {
private int initialVelocity;
private int duration;
private int acceleration;
public MovingObject(int initialVelocity, int duration, int acceleration) {
this.initialVelocity = initialVelocity;
this.duration = duration;
this.acceleration = acceleration;
}
public double displacement(){
return (initialVelocity*duration)+(0.5*acceleration*duration);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment