#include #include using namespace std; int main(){ const string morse[] { ".-",//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 }; const string message {" WELCOME TO COMPUTER SCIENCE"}; cout << message << '\n'; for ( int i{0}; i< message.size();++i) { char current {message[i]}; if (current == ' ') { cout << ' '; } else if (current >= 'A' && current <= 'Z') { cout << morse[current - 'A']; } else if (current >= 'a' && current <= 'z') { cout << morse[current - 'a']; } else { cout << '*'; } } cout << '\n'; return EXIT_SUCCESS; }