Hopefully you have your morning JAVA to help you get through this one. Start n and w off as 3 and use the result of findNorth to get ABC and the result of findWest to get DEF.
Final coords will be in the form N 41° 33.ABC W 072° 49.DEF
public static int findNorth(int n)
{
if(n < 555)
{
return findNorth(n * 3);
}
else if(n < 765)
{
return findNorth(n + 50);
}
else
{
return n - 20;
}
}
public static int findWest(int w)
{
if(w < 333)
{
return findWest(w * 5);
}
else if(w < 567)
{
return findWest(w + 77);
}
else
{
return w - 158;
}
}
You can check your answers for this puzzle on GeoChecker.com.