Question: Using Octave, write a function called first last letters whose input is a sentence (as a string). The words of the sentence are separated
Using Octave, write a function called "first last letters" whose input is a sentence (as a string). The words of the sentence are separated by single blanks, and there is a dot at the end of the sentence. The output will be a word (as a string) created by alternatingly picking the first and last letters of the words of the sentence: The first letter of the output string will be the first letter of the first word of the sentence. The second letter of the output string will be the last letter of the second word. The third letter will be the first letter of the third word, and so on. (You may NOT use any built-in functions except size. length, rem and mod) Example: If Sentence= 'The tree nut sings in no need." and Out = first last letters (Sentence) Out will be Out=Tension'
Step by Step Solution
3.34 Rating (151 Votes )
There are 3 Steps involved in it
To solve this problem in Octave you can create a function called firstlastletters Heres a stepbystep ... View full answer
Get step-by-step solutions from verified subject matter experts
