Question
For this lab you are required to create a class called CMorseConvert that converts a Text string into Morse Code (kind of). The
For this lab you are required to create a class called "CMorseConvert" that converts a Text string into Morse Code (kind of). The class will not convert the text to dashes and dots but to the words "dash" and "dot". As an example if the class is given the text string "1" the output would be "dot dash dash dash dash". Or if the class is given the text string "123" the output would be "dot dash dash dash dash dot dot dash dash dash dot dot dot dash dash". The CMorseConvert class will need to load the file "codes.dat" (which is already here, you just need to open it and read it in) with the mappings of the letters and numbers to the Morse Code. Here is a partial output of the "codes.dat" file:
A,.-
B,-...
C,-.-.
D,-..
E,.
The class needs to contain just one public function (you can have more but only one will be tested):
string Text2Morse(const string sText)
You can check your conversions using a real Morse Code Translator
I don't have access to codes.dat but you do not need it to write this code.
#include using namespace std;
int main() {
/* Type your code here. */
return 0; }
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