MmMm
2012-03-25 16:20:38 UTC
My attempt at it.
Not sure where to go from here.
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.print("Please enter a String for translation:");
String input = scan.nextLine();
scan.nextLine();
Switch (morseCode)
{
ase 1:
'a' = ".-";
break;
case 2:
'b' = "-...";
break;
case 3:
'c' = "-.-.";
break;
case 4:
'd' = "-..";
break;
case 5:
'e' = ".";
break;
case 6:
'f' = "..-.";
break;
case 7:
'g' = "--.";
break;
case 8:
'h' = "....";
break;
case 9:
'i' = "..";
break;
case 10:
'j' = ".---";
break;
case 11:
'k' = "-.-";
break;
case 12:
'l' = ".-..";
break;
case 13:
'm' = "--";
break;
case 14:
'n' = "-.";
break;
case 15:
'o' = "---";
break;
case 16:
'p' = ".--.";
break;
case 17:
'q' = "--.-";
break;
case 18:
'r' = ".-.";
break;
case 19:
's' = "...";
break;
case 20:
't' = "-";
break;
case 21:
'u' = "..-";
break;
case 22:
'v' = "...-";
break;
case 23:
'w' = ".--";
break;
case 24:
'x' = "-..-";
break;
case 25:
'y' = "-.--";
break;
case 26:
'z' = "--..";
break;
default:
System.out.println("Your input is invalid");
}
}