← Online Java Compiler - online X C 60 61 62 63 64 65 66 67 68 69 70 GPSCoordinateCo... : 1234576 7 78 79 77 80 81 82 83 84 85 86 } 87 88 89 ☀ onlinegdb.com/online_java_compiler# Run Debug } + if (direction double decimal Degrees Stop int seconds degrees } Share decimal Degrees -decimal Degrees; int direction if (direction degrees } System.out.println(decimal Degrees); } //FIX convertToDegreeMinsSeconds portion public static void convertToDegreeMinsSeconds (Scanner scnr){ System.out.print("Enter the decimal degrees (0 to 180): "); double degrees = scnr.nextInt(); int minutes scnr.nextInt(); scnr.nextInt(); = H Save degrees + (minutes / 60.0) + (seconds / 3600.0); 'S' || direction 'W'){ = {} Beautify Press ENTER to exit console. scnr.nextInt(); 'S' || direction -degrees; == 'W'){ degrees + (minutes* 60.0) + (seconds * 60.0); System.out.println(degrees + minutes + seconds); input Language Java JG
I am writing a GPS coordinate
This is what I have so far:
This is the output I'm looking for:
This program converts between two GPS coordinate systems:
1. degrees, minutes and seconds with a cardinal direction (N, S, E W)
to decimal degrees
2 decimal degrees to
degrees, minutes and seconds with a cardinal direction (N, S, E, W)
Your menu selection is: 3
Your menu selection is: 2
Enter the decimal degrees: 0 to 180: 30.26388888888889
0.2638888888888893
0
30 15 50.00000000000142 N OR E
Would you like to try another (Y/y or N/n to QUIT)?
N
Bye-bye
Unlock instant AI solutions
Tap the button
to generate a solution