Java tutorial
//package com.java2s; public class Main { public static String mode(String freq) { String ret = ""; double f = Double.parseDouble(freq); if (f > 1.8 && f < 1.843) ret = "CW"; else if (f >= 1.843 && f < 2.0) ret = "LSB"; else if (f >= 3.5 && f < 3.57) ret = "CW"; else if (f >= 3.57 && f < 3.6) ret = "RTTY"; else if (f >= 3.6 && f < 3.845) ret = "LSB"; else if (f >= 3.845 && f <= 3.88) ret = "SSTV"; else if (f > 3.88 && f < 3.9) ret = "AM"; else if (f > 3.9 && f < 4.0) ret = "LSB"; else if (f >= 7.0 && f < 7.04) ret = "CW"; else if (f >= 7.04 && f <= 7.045) ret = "RTTY"; else if (f > 7.045 && f < 7.07) ret = "CW"; else if (f >= 7.07 && f <= 7.075) ret = "PSK31"; else if (f > 7.075 && f <= 7.08) ret = "JT65"; else if (f > 7.08 && f < 7.125) ret = "CW"; else if (f >= 7.125 && f < 7.290) ret = "LSB"; else if (f >= 7.290 && f <= 7.3) ret = "AM"; else if (f >= 10.1 && f < 10.13) ret = "CW"; else if (f >= 10.13 && f <= 10.14) ret = "RTTY"; else if (f > 10.14 && f <= 10.15) ret = "CW"; else if (f >= 14.0 && f < 14.07) ret = "CW"; else if (f >= 14.07 && f <= 14.095) ret = "RTTY"; else if (f >= 14.095 && f < 14.15) ret = "CW"; else if (f >= 14.15 && f < 14.35) ret = "USB"; else if (f >= 18.068 && f < 18.11) ret = "CW"; else if (f >= 18.11 && f <= 18.168) ret = "USB"; else if (f >= 21.0 && f < 21.07) ret = "CW"; else if (f >= 21.07 && f < 21.11) ret = "RTTY"; else if (f >= 21.11 && f < 21.2) ret = "CW"; else if (f >= 21.2 && f <= 21.45) ret = "USB"; else if (f >= 24.890 && f < 24.93) ret = "CW"; else if (f >= 24.93 && f <= 24.99) ret = "USB"; else if (f >= 28.0 && f <= 28.3) ret = "CW"; else if (f >= 28.3 && f < 29.0) ret = "USB"; else if (f >= 29.0 && f < 29.2) ret = "AM"; else if (f >= 29.2 && f < 29.7) ret = "FM"; else if (f >= 50.0 && f < 50.1) ret = "CW"; else if (f >= 50.1 && f < 52.0) ret = "USB"; else if (f >= 52.0 && f <= 54.0) ret = "FM"; return ret; } }