Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions