If you must do a bubble sort, google it. I'm sure wiki pedia will tell you how tp implement it, if not implement it for you!

Also,

answer.equals("y") || answer.equals("Y")

can become
...