Question: Now it's Your turn, again. Write a function (reverse sentence. m) that takes a single input argument which is a string containing a sentence (a

 Now it's Your turn, again. Write a function (reverse sentence. m)

Now it's Your turn, again. Write a function (reverse sentence. m) that takes a single input argument which is a string containing a sentence (a sequence of words) and returns a single output argument which is a string containing the words in the input string in reverse order. For example, on input ' the quick brown fox jumps over the lazy dog', the function should return ' dog lazy the over jumps fox brown quick the'. Remember to think before you code. Have pencil and paper next to you and sketch your algorithm as pseudocode or flow diagram. I will get you started on this one: Split the sentence at whitespace to form an array of words. Reverse the array of words. Construct the reversed sentence by joining the words in the array with spaces

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!