Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. final double KILOMETERS_PER_METER = 0.001;
  2. final float HOURS_PER_SECOND = 2.77777778e-4f;
  3.  
  4. float time = 9.0f;
  5. double acceleration = 0.6;
  6.  
  7. double initialSpeed, currentSpeed;
  8. float distance;
  9.  
  10. time *= HOURS_PER_SECOND;
  11.  
  12. acceleration *=
  13. KILOMETERS_PER_METER /
  14. (HOURS_PER_SECOND * HOURS_PER_SECOND);
  15.  
  16. currentSpeed = initialSpeed + acceleration * time;
  17.  
  18.  
  19. float initialSpeed = Float.parseFloat (
  20. txtInitialSpeed.getText());
  21.  
  22. lblCurrentSpeed.setText(
  23. Double.toString(currentSpeed));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement