I\'m new to Java. I wrote the following code:
import java.io.*; import java.lang.*; public class distravel { public static void main(String args[])
Don't use floats in your floating point math calculations unless you have a specific reason for doing so (you don't). The overhead for the preferred type, double, is not much higher and the benefit in accuracy is great.