Question: Write a C++ program and name it Morse One Array. The program will take a string input from the use and return the string in

Write a C++ program and name it Morse One Array. The program will take a string input from the use and return the string in Morse code. The program will prompt the user for a word or sentence in plain English. Output the Morse Code such that there is one space between each set of Morse Code characters and two spaces between each word. Think about upper and lower case letters and the issues they might cause. For this program you only allowed to use ONE ARRAY! I would suggest the array is for the Morse Code symbols. The ASCII table is your best friend here.

Morse Code Alphabet

International Morse Code

A

. _

B

_ . . .

C

_ . _ .

D

_ . .

E

.

F

. . _ .

G

_ _ .

H

. . . .

I

. .

J

. _ _ _

K

_ . _

L

. _ . .

M

_ _

N

_ .

O

_ _ _

P

. _ _ .

Q

_ _ . _

R

. _ .

S

. . .

T

_

U

. . _

V

. . . _

W

. _ _

X

_ . . _

Y

_ . _ _

Z

_ _ . .

To make things easier for you I have included the two Arrays:

string myCode[27] = { ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..",".---","-.-",".-..","--", "-.","---",".--.", "--.-",".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--..", " " };

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!