Question
INSTRUCTIONS: MESSAGE 1 : -.. --- -. - ....... ..-. --- .-. --. . - ....... - --- ....... -.. .-. .. -. -.- .......
INSTRUCTIONS:
MESSAGE 1 : -.. --- -. - ....... ..-. --- .-. --. . - ....... - --- ....... -.. .-. .. -. -.- ....... -.-- --- ..- .-. ....... --- ...- .- .-.. - .. -. . x MESSAGE 2 : .-- --- ..- -. -.. ... ....... -- -.-- ....... .... . .- .-. - ....... .-- .. - .... ....... .- ....... -- --- -. --- - --- -. --- ..- ... ....... .-.. .- -. --. --- ..- .-. x
=============================================================================================
BELOW IS MY CODE BUT I CANNOT GET IT TO COMPILE PLEASE HELP!!
=============================================================================================
#include
using namespace std;
class Code { public: Code(); // Default constructor - loads and uses morse code
string decode(vector message); // decodes a message
private:
vector
vector
vector
char decode(string c); //returns the character for the codeword c.
}; Code::Code() { alpha = alphacode(); codewords = morsecode(); } vector char Code::decode (string c) { for( int i = 0; i message) { string str= " "; for (int i=0; i int main () { string filename; cout> filename; ifstream ifs (filename.c_str()); if(!ifs.is_open()) { cout message; string c; cin>>c; while (c!=x) { message.pushback(c); cin>>c; if (message=="x") { cout message.pushback(x); }
Step 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