Question: Please answer in C. I have included my source code below from previous question. #include # define MAX 1000 void morseEncoder(char * str) { for

Please answer in C. I have included my source code below from previous question.

Please answer in C. I have included my source code below from

#include # define MAX 1000 void morseEncoder(char * str) { for (int i = 0; str[i]; i++) { switch (str[i]) { case 'A': printf(".- "); break; case 'B': printf("-... "); case 'C': printf("-.-. "); break; case 'D': printf("-.. "); break; case 'E': printf(". "); break; case 'F': printf("..-. "); break; case 'G': printf("--. "); break; case 'H': printf(".... "); break; case 'I': printf(".. "); break; case 'J': printf(".--- "); break; case 'K': printf("-.- "); break; case 'L': printf(".-.. "); break; case 'M': printf("-- "); break; case 'N': printf("-. "); break; case 'O': printf("--- "); break; case 'P': printf(".--."); break; case 'Q': printf("--.- "); break; case 'R': printf(".-. "); break; case 'S': printf("... "); break; case 'T': printf("- "); break; case 'U': printf("..- "); break; case 'V': printf("...- "); break; case 'W': printf(".-- "); break; case 'X': printf("-..-"); break; case 'Y': printf("-.-- "); break; case 'Z': printf("--.. "); break; case ' ': //3 space between each word printf(" "); break; default: printf("? "); } } }

void to_upper_case(char s[]) // lower case to upper case converter { int c = 0; while (s[c]) { if (s[c] >= 'a' && s[c]

int main() { char str[MAX];

printf("Enter the sentence to be converted: "); scanf("%[ ]%*c", str); to_upper_case(str); // conert to uppercase before encoding morseEncoder(str); return 0; }

(2) Reverse Morse Code Write a program called reverseMorseCode.c that takes in a morse code string sequence from the user (as produced from the program above) and converts it back into the original ASCIl sentence as follows Enter the Morse Code sequence: Here is the decoded message: I LOVE C Note that the spacing between the words in the final output is arbitrary and may vary according to whatever you want, as long as the words come out properly. The '?' characters should stay as '? character in the output

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!