Limited Offer Get 25% off β€” use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now

Why is this not compiling? This is a C++ morse code decoder program. It has two

Why is this not compiling? This is a C++ morse code decoder program. It has two errors. I have bolded and italicized the errors and messages. #include #include #include struct TREENODE{char letter;TREENODE *left;TREENODE *right;TREENODE() //constructor{letter = β€˜*’; //will replace with letterleft = 0;right = 0;};struct MORSECODE//each morsecode object has english letters{char letter;char code[20]; //dots and dashes and such};class TELEGRAPH //binary tree{private:static MORSECODE table[40];static TREENODE * root;static void destroyTree(TREENODE *node);public:TELEGRAPH(){root = NULL;} // expected unqualified-id at end of input. no return statement in function returning non-void (-Wreturn type)static void buildTree();static void destroyTree();void Encode(char text[], char morse[]);void Decode(char morse[], char text[]);};MORSECODE TELEGRAPH::table[40] = {{β€˜E’,”.”}, {β€˜T’, β€œ-β€œ}, {β€˜I’, β€œ..”}, {β€˜A’, β€œ.-β€œ}, {β€˜N’, β€œ-.”}, {β€˜M’, β€œβ€“β€œ},{β€˜S’, β€œβ€¦β€}, {β€˜U’, β€œ..-β€œ}, {β€˜R’, β€œ.-.”}, {β€˜W’, β€œ.β€“β€œ}, {β€˜D’, β€œ-..”}, {β€˜K’, β€œ-.-β€œ},{β€˜G’, β€œβ€“.”}, {β€˜O’, β€œβ€”β€œ}, {β€˜H’, β€œβ€¦.”}, {β€˜V’, β€œβ€¦-β€œ}, {β€˜F’, β€œ..-.”}, {β€˜L’, β€œ.-..”},{β€˜P’, β€œ.–.”}, {β€˜J’, β€œ.β€”β€œ}, {β€˜B’, β€œ-…”}, {β€˜X’, β€œ-..-β€œ},{β€˜C’, β€œ-.-.”}, {β€˜Y’, β€œ-.β€“β€œ}, {β€˜Z’, β€œβ€“..”}, {β€˜Q’, β€œβ€“.-β€œ}, {β€˜0’, β€œβ€”β€“β€œ}, {β€˜1’, β€œ.β€”-β€œ), {β€˜2’, β€œ..β€”β€œ},{β€˜3’, β€œβ€¦β€“β€œ}, {β€˜4’, β€œβ€¦.-β€œ}, {β€˜5’, β€œβ€¦..”}, {β€˜6’, β€œ-….”}, {β€˜7’, β€œβ€“β€¦β€}, {β€˜8’, β€œβ€”..”}, {β€˜9’, β€œβ€”-.”},{β€˜,’, β€œβ€”-β€œ}, {β€˜.’, β€œ.-.-.-β€œ}, {β€˜?’, β€œ..–..”}, {”, β€œEND”};TREENODE* TELEGRAPH::root = 0;void TELEGRAPH::Decode(char morse[], char text[]){char *morsePtr;TREENODE *node;node = root;cout << "Decode called." <left;}else if (*morsePtr == β€˜-β€˜){nose = node >right;}}else {node = root;}continue;}*text++ = node-> letter;return;}void TELEGRAPH::Encode(char text[], char morse[]){int i;char c, *t, *morsePtr;cout << "Encode called" << endl;cout <>> β€œ;for (t = text; *t; t++){c = toupper(*t);if (c == β€˜ β€˜){*morse++ = β€˜ β€˜;continue;}for (i = 0; table[i].letter; i++){if (table[i].letter == c) break;}if (!table[i].letter){continue;}morsePtr = table[i].code;while (*morsePtr){*morse++ = *morsePtr++;}*morse++ = β€˜ β€˜;}}void TELEGRAPH::buildTree(){TREENODE *node, *nextNode;char *morsePtr; // point to dots and dashes in tableroot = new TREENODE;if (!root){return;}root -> letter = β€˜ β€˜;cout << "Alphabet in Morse:";for (int i = 0; table[i].letter; i++){node = root;for (morsePtr = table[i].code; *morsePtr; morsePtr++)//goes through morse code for symbols and letters{if (*morsePtr == '-'){cout <right = nextNode;node = node->right;}else if (*morsePtr == β€˜.’){cout <left = nextNode;node = node->left;}}}}main():int main(){TELEGRAPH station;char text[80], morse[600];station.buildTree();cout << "Enter telegram in English: ";cin.getline(text, 80);station.Encode(text, morse);cout << morse;cout <>> Receivednn”;station.Decode(morse, text);cout << "Message sent: " << text << endl;station.destroyTree();} //expected ';' at end of member declaration. expected '}' at end of input. invalid use of qualified name TREEDNODE::TELEGRAPH::table

The post Why is this not compiling? This is a C++ morse code decoder program. It has two appeared first on Get Papers.

Source: My posts

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

βœ“ Native UK, USA & Australia writers βœ“ Deadline from 3 hours βœ“ 100% Plagiarism-Free β€” Turnitin included βœ“ Unlimited free revisions βœ“ Free to submit β€” compare quotes
Scroll to Top