I'm making some calculations on my project in order to see how many trucks could be parked on a road of X meters.
I have this:
int road1 = 140;
double trucks = 0;
trucks = (road1-10)/20;
System.out.println("trucks"+trucks);
The problem is that if you calculate by yourself, the result will be 6.5. So you could park 6.5 trucks.
But I always get 6.0