help with loops and output

Write a code segment to read in first names until the user enters quit for the name (the letters in “quit” can be of any case). Create a new string that contains all the names entered separated by a comma. Display the string of names at the end. Use a while loop. The format of the output should be:

Manjula, Homer, Karl, Maggie

this is what i got so far...it does not quit when i type quit, i need it to stop the loop when i type "quit". Also how do i output the names that are inputted from user, i need it to output like this: Manjula, Homer, Karl, Maggie

Do you have any ideas? Could you print the names as soon as you know about them? Or do you have to save them and wait? And if you have to save them, what type would you use to hold a whole lot of Strings?

i am not sure... i think as long as it's on the same line it would be correct.. in order to do that on one line i believe i would have to save the names somehow. because the line asking for another name would split all the names up.

so basically... with the names. They want them on one line and split up with commas.