I am trying to get quotes and then organize them by their last names. If that is equal than by their first names and then by the quote. My problem is that when I output it outputs the correct answer twice. Another problem is that if I have 10 lines of "last, first, "quote"" and I say my N=9 it wont work. Please help. Thanks in a advance.
Could you please be a little more specific about what happens when you say it doesn't work? Are you getting runtime errors, if so which ones? What output do you expect and what output do you get instead?
My input is:
tim, jones, "I love you"
joe, ephraim, "Baby come back!"
mary, motion, "OH no she did it again"
sam, sled, "No"
sam, bubble, "Help"
The problem is that if I have 6 lines in my file input and I N=5 this happens
My output is:
, bubble, "Help"
, bubble, "Help"
, bubble, "Help"
, bubble, "Help"
, bubble, "Help"
But if N= to the exact amount of lines in my file it works fine.
What I am trying to get is:
"All Day All Long", orange, apple
apple, orange, "All Day All Long"
joe, ephraim, "Baby come back!"
mary, motion, "OH no she did it again"
sam, bubble, "Help"