Create a structure that holds your two variables a character and a string(for morse code)
Create an array with that structure type the represent each possible character.
Initialize your alphabet for both plain text and the corresponding morse code.
Code:
// Like this
characters[15].plainTxt = 'o'
characters[15].morse = "-.-.-."
characters[19].plainTxt = 's'
characters[19].morse = "---"
Now you got the objects that hold the values of both cases, and it in an easily sortable array. Now go through the string that you read in and (assuming you found the string to be text not morse), have a loop that cycles through the plainTxt values in the array and when it finds a match output the morse value of that array.
I'm not gonna write this code for you cause I want you to try and grasp the concept I'm telling you.