Question: Function Name: girlfriend Inputs: 1. (char) Filename with mixed up song lyrics File Outputs: 1. A.txt file with the lines correctly ordered. Topics: (cell

Function Name: girlfriend Inputs: 1. (char) Filename with mixed up song lyrics File Outputs: 1. A.txt file with the lines correctly ordered. Topics: (cell arrays), (sorting) Background: You're writing Avril's next chart topper! Unfortunately, your bae is distracting you so much that you're writing all the heart wrenching lines out of order! Function Description: Given the filename of a .txt file with lines of the form ' ', correctly order the file lines and print those lines to a new file named reordered.txt'. The line numbers should be deleted from the lines when they are printed to the new text file. An extra newline at the end of the output text file is required. Example: lyrics.txt 1 2 No way, no way, I think you need a new one 21 3 Hey hey, you you, I could be your girlfriend 3| 1 Hey hey, you you, I don't like your girlfriend girlfriend (lyrics.txt'); lyrics reordered.txt - 1 Hey hey, you you, I don't like your girlfriend 21 No way, no way, I think you need a new one 31 Hey hey, you you, I could be your girlfriend 4| Notes: Hints: There will always be exactly one space between the correct line number and the song lyrics The sort function works on cells containing data type char, but not cells containing data type double
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
