I have to do some kind of Google Maps like program on Java, I have the following code:
public double CGlon(double graus, double min, double sec)
{
double min2;
graus =(int) longitud;
min = (longitud - graus)*60;
min2 = (int) min;
sec = (min-min2)*60;
return(graus);
return(min); //Unreachable point
return(sec); //Error
}
where I have to convert the coordinates, 41,234234º into 41º 23' 122" , for example. And I'm calling on the main program:
public class GPS {
private static final int graus = 0;
public static void main(String[] args) {
// TODO Auto-generated method stub
TempClass lloc1 = new TempClass();
TempClass lloc2 = new TempClass();
TempClass lloc3 = new TempClass();
TempClass lloc4 = new TempClass();
//Inicialitzacio de les dades
//ETSE
lloc1.nomSet("ETSE");
lloc1.latitudSet(41.1258048);
lloc1.longitudSet(1.2385834);
System.out.println(lloc1.CGlat(graus, 0, 0)+" graus"+lloc1.CGlat(0, 0, 0)+" minuts y "+lloc1.CGlat(0, 0, 0)+" segons de latitud.");
the problem is that i'm having an unreachable error on the 'min' variable and i dont know why.