package class011_6_1_UML_etc; public class Dragster { private double distanceMeters; private double speedMetersPerSecond; public static final double STEP_SIZE_SECONDS = 1.0; public void setSpeedMetersPerSecond(double speed) { this.speedMetersPerSecond = speed; } public void moveSteps(int numSteps) { int i = 0; // exit condition: i == numSteps while(i < numSteps) { distanceMeters += speedMetersPerSecond * STEP_SIZE_SECONDS; i = i + 1; } } public double getDistanceMeters() { return distanceMeters; } }