Question
help me translate English texting into Morse Code and visa versa using a format like this : #include using namespace std; class character { private:
help me translate English texting into Morse Code and visa versa using a format like this :
#include
using namespace std;
class character
{
private:
char english;
string morse;
public:
Alphabet(char,string);
char getEnglish() const;
string getMorse() const;
}
class translator
{
private:
charactor array[36]
public:
translator()
{
array[0]=charactor('a',"-");
}
Requirements
1. The approach should be Object Oriented. I don't want to see parallel arrays or a long if/else if/else or switch statement. 2. Prompt the user to enter a sentence. This means you must support whitespace in the string input. The sentence can have a maximum of 50 characters. 3. Output the sentence character by character by translating the character into it's Morse Code equivalent. You can print each on an individual line or on one line separated by a space. 4. Use the Morse Code table as shown on Wikipedia. Represent with periods and hyphens. For example the character 'B' would be output as string "-..." 5. Morse Code is case insensitive. 'a' and 'A' are the same character. You will need to handle this in your code. 6. You can ignore any character in the sentence that is not a letter or number. 7. I will not only be grading program correctness, I'm also going to be grading your Object Oriented approach. So please take the time to think about the design of the program before implementing.
Note: if you also support translating Morse Code into English Alphabet characters. You can ask the user to separate the Morse codes with a space. Same rules apply as above, except you'll expect Morse codes as input and output the sentence. You must support more than one character. The sentence you output can be all upper or lower case characters. You do not have to be case sensitive in your output.
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