Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone help me will give A+ rating. #include<iostretam> #include <cctype> #

ID: 3642193 • Letter: C

Question

Can someone help me will give A+ rating.

#include<iostretam>
#include <cctype>
#include<cstring>

using namespace std;

int main()
{

char morseCode[37][6]={".-","-...","-.-.","-..",".","..-.","--.","....","..",".---",
"-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-",
"..-","...-",".--","-..-","-.--","--..",".----","..---","...--",
"....-",".....","-....","--...","---..","----.","-----"," "};
char input[50];
char letnum[37]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
'Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6',
'7','8','9','0',' '};
int i=0,j,k;
cout<<"Please input string to be converted to morse code: "<<endl;
cin.getline(input);

while(input[i]!='')
{
for(j=0;j<37;j++)
{
if(toupper(input[i])==letnum[j])
{
for(k=0;k<strlen(morseCode[j]);k++)
cout<<"%c"<<morseCode[j][k]<<endl;
cout<<" "<<endl;
}
}
i++;
}


system("pause");

return 0;
}

Explanation / Answer

What's the error exactly? could be a number of things

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote