package races;

import java.util.Random;

public class Horse {
    Random rand = new Random();
    double speed;
    String name;
    double distance;

    Horse(String name, double speed) {
        this.name = name;
        this.speed = speed;
        distance = 0;
    }
    
    double runForOneSecond() {
        distance = distance + speed + rand.nextInt(5);
        System.out.println(name + " has run " + distance);
        return distance;
    }
}