Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective a use one-dimensional arrays; strings and various string-handling methods; file input and output; console input and output; loops; and conditional program statements. Instruction You

Objective a use one-dimensional arrays; strings and various string-handling methods; file input and output; console input and output; loops; and conditional program statements. Instruction You are asked to a program that translates a Morse code message into the English language. The program will ask the user to enter filenames for two input files, one for the code translation table data and the other for the coded message data, as well as an output file that will receive the decoded message text. Initially, the program reads the code translation table data file and stores the alphabet characters and equivalent Morse code in two one-dimensional arrays. The program will then read the message input file, inspecting each Morse code value and converting it to the English-language equivalent. The program will write decoded words to the output file and will print short informational messages to the console (screen). Morse code words in the message input file have one space between each Morse-coded letter. There is ONE word per line in the data file.

-Here is a sample run. User input appears as bold underline:

Enter the Morse Code translation table file path: c:/temp/morse.txt

Code translation file processed. 39 codes loaded.

Enter the coded message input file path: c:/temp/CodedMessage.txt

Enter decoded message output file path: c:/temp/DecodedMessage.txt Message translation complete.

17 words processed. Here is the output file DecodedMessage.txt contents:

  • --Here is the output file DecodedMessage.txt contents:
  • image text in transcribedimage text in transcribed
Code Translation Table: Character Code Character Code A U B -. . . V . . .- C -.-. W D -.. X -..- E Y -.-- F ..". Z --.. G --. H . . .. UI AWN - I . . ."- J . . .." K -.- . . ... L .-.. 6 -. . . M --. . . N -. 8 O 9 P 0 O R .". ? ..".. . . . (full stop) T\f

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Find the unit vector in the opposite direction of (1,2,3)

Answered: 1 week ago