Question: How do I get my code to show virticle rather then horozontal? #include #include using namespace std; / / Implement the function / / with

How do I get my code to show virticle rather then horozontal?
#include
#include
using namespace std;
//Implement the function
//with parameter as a character
string getCode(char eachChar)
{
//Define the string input text
string text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string morse[]={".-","-...","-.-.","-..",".","..-.","--.",
"....","..",".---","-.-",".-..","--",
"-.","---",".--.","--.-",".-.","...","-",
"..-","...-",".--","-..-","-.--","--.."};
//Get the index for the character
int index = text.find(eachChar);
//If the index is not equal to -1
//then return index
if (index !=-1)
return morse[index];
//Otherwise return space
else
return "";
}
//main method
int main()
{
//Declare the string variable
string input,morseCode="";
//Prompt and read the word from the user
cout << "Enter a word and will translate it to Morse code:";
getline(cin, input);
//Using for-loop to get the morse code from the method
for (int i =0; i

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!