3 private double distance
;
4 private double travelTime
;
6 public Road(int speed
, double distance
) {
8 this.distance
= distance
;
9 this.travelTime
= distance
/ (speed
/ 3.6);
13 * Gets the value of speed
15 * @return the value of speed
17 public final int getSpeed() {
22 * Gets the value of distance
24 * @return the value of distance
26 public final double getDistance() {
31 * Gets the value of travelTime
33 * @return the value of travelTime
35 public final double getTravelTime() {
36 return this.travelTime
;
39 public String
toString() {
40 return new Double(this.travelTime
).toString();