Morse Code Converter
Morse code is a code where each letter of the English alphabet, each digit, and various punctuation characters are represented by a series of dots and dashes. Table 10-14 shows part of the code. Write a program that asks the user to enter a string, and then converts that string to Morse code. Use hyphens for dashes and periods for dots.
Table 10-14: Morse code
Character | Code | Character | Code | Character | Code | Character | Code |
space | space | 6 | -.... | G | --. | Q | --.- |
comma | --..-- | 7 | --... | H | .... | R | .-. |
period | .-.-.- | 8 | ---.. | I | .. | S | ... |
question mark | ..-.. | 9 | ----. | J | .--- | T | - |
0 | ---- | A | .- | K | -.- | U | ..- |
1 | .---- | B | -... | L | .-.. | V | ...- |
2 | ..--- | C | -.-. | M | -- | W | .-- |
3 | ...-- | D | -.. | N | -. | X | -..- |
4 | ....- | E | . | O | --- | Y | -.-- |
5 | ..... | F | ..-. | P | .--. | z | --.. |
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.