Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming The MorseConvert program will need to load the file codes.dat with the mappings of the letters and numbers to the Morse

C++ Programming

The MorseConvert program will need to load the file "codes.dat" with the mappings of the letters and numbers to the Morse Code.

Develop a function that has the following signature:

bool LoadMorseCodes(Code arrCodes[], const int iTotalCount)

The function will open the file codes.datimage text in transcribed, reads its contents and store the data in the array of "Code" structures passed to it. Finally the function should close the file before it exits.

Note: Even though there are exactly 36 codes, develop the function so that it "loops"

const int iTotalCount 

times and not a hard-coded 36.

Your function must use std::string functions to parse the data. I recommend functions like find() and substr().

codes.dat file contents:

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,--..

1,.----

2,..---

3,...--

4,....-

5,.....

6,-....

7,--...

8,---..

9,----.

0,-----

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

LO1 Understand human resource management and define human capital.

Answered: 1 week ago