Question: I am writing a program to convert text into morsecode and vice versa. I keep getting an issue at compilation time. Im not sure how

I am writing a program to convert text into morsecode and vice versa. I keep getting an issue at compilation time. Im not sure how to explain the If someone could compile the program and tell me what the issue is, that would be great and fix it, thatd be great.

Update: the error I kept getting was undefined symbols for 64 x86 architecture.

Programing language is c++

MorseMain.cpp

#include

#include "TransInfo.h"

int main()

{

string uI; //stores user input

//Initialize our maps/translations

TransInfo::initTranslation();

//Reads for input from user until eof is detected

while(getline(cin, uI))

{

//Figure out whether input is morse or english:

if(TransInfo::isEnglish(uI))

{

cout << TransInfo::toMorse(uI) << endl;

}

else

{

cout << TransInfo::toEnglish(uI) << endl;

}

}

return 0;

}

TransInfo.cpp

#include

#include "TransInfo.h"

int main()

{

string uI; //stores user input

//Initialize our maps/translations

TransInfo::initTranslation();

//Reads for input from user until eof is detected

while(getline(cin, uI))

{

//Figure out whether input is morse or english:

if(TransInfo::isEnglish(uI))

{

cout << TransInfo::toMorse(uI) << endl;

}

else

{

cout << TransInfo::toEnglish(uI) << endl;

}

}

return 0;

}

TransInfo.h

#ifndef TRANSINFO_H

#define TRANSINFO_H

#include

#include

using namespace std;

// I am using static methods so we don't have to declare an instance of the class in our program

// We are using map to store information about the morse code and the letters that need to be translated

class TransInfo

{

public:

// The english translation map holds translation information

static map englishTranslation;

// the morseTranslation map holds information on morsecode translation

static map morseTranslation;

// The following initializes the translation

static void initTranslation();

// The following checks if input is english

static bool isEnglish( const string& userInput );

// The following converts to morse

static string toMorse( const string& english );

// The following converts back to english

static string toEnglish( const string& morse );

// Constructor and de-constructor

TransInfo();

~TransInfo();

};

#endif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!