все правильно, (скорость * на целое число)
выдает ошибку
package com.javarush.task.task21.task2113;
import static java.lang.Math.*;
public class Horse {
String name; //переменные
double speed;
double distance;
public Horse(String name, double speed, double distance){ //конструктор
this.name = name;
this.speed = speed;
this.distance = distance;
}
public void setName(String name){
this.name = name;
} //сеттеры
public void setSpeed(double speed){
this.speed = speed;
}
public void setDistance(double distance){
this.distance = distance;
}
public String getName(){
return name;
} //геттеры
public double getSpeed(){
return speed;
}
public double getDistance(){
return distance;
}
public void move(){
//int n = (int)(Math.random()*10);
distance = distance + (speed* (int)(Math.random()*10));
//System.out.println(distance);
} //методы
public void print(){
}
}