Answered step by step
Verified Expert Solution
Question
1 Approved Answer
******I ONLY NEED ENCODE NOT DECODE*********** In this homework assignment, you are golng to write 2 programs to encode and decode messages using codes such
******I ONLY NEED ENCODE NOT DECODE***********
In this homework assignment, you are golng to write 2 programs to encode and decode messages using codes such as Morse code. NOT You will he writing two programs. Both programs will use the class Code. One program will use the class to encode a messaqe. The second wll use the code to decode the message. The Morse code table 1s glven below: International Morse Code A dashis equalto thzee dots 2 The space between parts of the same letter is equal to one dot. 3 The space between two letters is equal te three dots 4 "paca b ween two weeds isojualto seven does Our software wtll support codes that consist of symbols followed by a blank space. For example, in a message if an A appears, it will be replace by .- *. The tratling space indtcates the end of the codeword for that character. (NOTE: We will only be using the characters A-Z. Morse code words are separated by a space, so the message "cat would be --. .--x where x indicates the end of message. Note that spaces between words are denoted by 7 dots ". . You can assume that encoded messages end with a lowercase x (which means STOP). When converting a message from text to code, a period "." should be converted to an x.) Requirements Your prugram should include the lowing class: public Code Detault constructor laads and uses merse code Code vectorint codewords) constructor loading custonizcd code string encodelvectorcchars nessage encodes anessage consisting of A-z tring decodelvectorsstringa nessag: decodes a nessage private: vectorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started