I can't find a way to input on the screen value of the words in Morse Alphabet : Don't be punish please me , I am just trying to create a output Morse Alphabet in java , but in my case , there are problems , when I input the letter , this coincide to my require , for example - A output ".-" .
There are two problems in my program , first , if I enter B and after D for example there is no output . Second problem , this is not work for words , when I entering word .

public class Example {

    public static void main(String[] args) {
        Map<String, String> map = createAlphabet();
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
 
        for (Map.Entry<String , String> entry : map.entrySet()){
            if (entry.getKey().equalsIgnoreCase(s)){
                System.out.println(entry.getValue());
            }
        }

    }

    public static Map<String , String> createAlphabet() {
        Map<String , String> alphabet = new HashMap<>();

        alphabet.put("A" , ".-");
        alphabet.put("B" , "-...");
        alphabet.put("C" , "-.-");
        alphabet.put("D" , "-..");
        alphabet.put("E" , ".");
        alphabet.put("F" , "..-.");
        alphabet.put("G" , "--.");
        alphabet.put("H" , "....");
        alphabet.put("I" , "..");
        alphabet.put("J" , ".---");
        alphabet.put("K" , "-.-");
        alphabet.put("L" , ".-..");
        alphabet.put("M" , "--");
        alphabet.put("N" , "-.");
        alphabet.put("O" , "---");
        alphabet.put("P" , ".--");
        alphabet.put("Q" , "--.-");
        alphabet.put("R" , ".-.");
        alphabet.put("S" , "...");
        alphabet.put("T" , "-");
        alphabet.put("U" , "..-");
        alphabet.put("V" , "...-");
        alphabet.put("W" , ".--");
        alphabet.put("X" , "-..-");
        alphabet.put("Y" , "-.--");
        alphabet.put("Z" , "--..");


        return alphabet;
    }
}


