Question: Create a program that can encode and decode messages. Using the following information: Alphacode function: vector alphacode() {// This returns a vector containing the alphabet
Create a program that can encode and decode messages. Using the following information:
Alphacode function:
vectoralphacode() {// This returns a vector containing the alphabet a-z and " " vector temp; for (char c='A'; c
Morsecode function: vectormorsecode() { // This function returns a vector containing the morse code vector temp(28); temp[0] =".-"; temp[1] ="-..."; temp[2] ="-.-."; temp[3] ="-.."; temp[4] ="."; temp[5] ="..-."; temp[6] ="--."; temp[7] ="...."; temp[8] =".."; temp[9] =".---"; temp[10] ="-.-"; temp[11] =".-.."; temp[12] ="--"; temp[13] ="-."; temp[14] ="---"; temp[15] =".--."; temp[16] ="--.--"; temp[17] =".-."; temp[18] ="..."; temp[19] ="-"; temp[20] ="..-"; temp[21] ="...-"; temp[22] =".--"; temp[23] ="-..-"; temp[24] ="-.--"; temp[25] ="--.."; temp[26] ="......."; temp[27] ="x"; return temp; }

Requirements Your program should include the following class class Code public: Code): //Default constructor-loads and uses morse code Code(vectorint> codewords); // constructor loading customized code string encode(vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
