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.
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.
// Like this
characters.plainTxt = 'o'
characters.morse = "-.-.-."
characters.plainTxt = 's'
characters.morse = "---"
I'm not gonna write this code for you cause I want you to try and grasp the concept I'm telling you.