Morse Code Converter
Write a program that asks the user to enter a string and then converts that string to Morse code. 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 8-15 shows part of the code.
Table 8-15 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.