Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 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 currentSpeed;
  8. float distance;
  9.  
  10. Double initialSpeed1 = Double.parseDouble (txtInitialSpeed.getText());
  11.  
  12. time *= HOURS_PER_SECOND;
  13.  
  14. acceleration *= KILOMETERS_PER_METER / (HOURS_PER_SECOND * HOURS_PER_SECOND);
  15.  
  16. currentSpeed = initialSpeed1 + acceleration * time;
  17.  
  18.  
  19.  
  20. lblCurrentSpeed.setText(
  21. Double.toString(currentSpeed));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement